Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Update the docs #52

Open
ghost opened this issue Apr 17, 2018 · 1 comment
Open

Update the docs #52

ghost opened this issue Apr 17, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 17, 2018

Please, the docs are confusing to init. I think that added some code lines will be more clearly to start with this module. I'm assuming that use is defined on head of php file to work with namespaces:

  • Add a empty array to BooBoo constructor prevent: Uncaught ArgumentCountError (Too few arguments to function League\BooBoo\BooBoo::__construct()).
  • Get an order to work with BooBoo.
  • Understand the workflow from this application.
// first
$booboo = new BooBoo([]);

// set formatters before call register
$html = new HtmlFormatter();
$null = new NullFormatter();

$html->setErrorLimit(E_ERROR | E_WARNING | E_USER_ERROR | E_USER_WARNING);
$null->setErrorLimit(E_ALL);

$booboo->pushFormatter($null);
$booboo->pushFormatter($html);

// finally, call to register to run BooBoo
$booboo->register();

The main error can be resolved added a default empty array to BooBoo constructor too if you want to add any code modification.

Thanks.

@gamersalpha
Copy link

i don't understand how works this lib do u have some cookbook or more explain please


<?php

require 'vendor/autoload.php';

use League\BooBoo\BooBoo;
use League\BooBoo\Exception;
use League\BooBoo\Formatter\HtmlFormatter;
use League\BooBoo\Formatter\NullFormatter;
use League\BooBoo\Handler;
use League\BooBoo\Util;



// first
$booboo = new BooBoo([]);

// set formatters before call register
$html = new HtmlFormatter();
$null = new NullFormatter();

$html->setErrorLimit(E_ERROR | E_WARNING | E_USER_ERROR | E_USER_WARNING);
$null->setErrorLimit(E_ALL);

$booboo->pushFormatter($null);
$booboo->pushFormatter($html);
// This causes a fatal error
echo $toto;
// finally, call to register to run BooBoo
$booboo->register();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant