Class Leo
Class Leo. Singleton access to Leo and all of its internals. A singleton is used as opposed to static methods and properties because of how php handles static closures.
For instance:
Leo::extend(callable $fn) will not allow binding of variables inside $fn - i.e via the DynamicObjectTrait
public
Peridot\Leo\Assertion
public
mixed
setAssertion( mixed $assertion )
Set the Assertion used by Leo.
Set the Assertion used by Leo.
Parameters
- $assertion
Returns
mixed
$this
public
Peridot\Leo\Formatter\FormatterInterface
public
mixed
setFormatter( Peridot\Leo\Formatter\FormatterInterface
$formatter )
Set the FormatterInterface used by Leo.
Set the FormatterInterface used by Leo.
Parameters
- $formatter
Returns
mixed
$this
public
Peridot\Leo\Responder\ResponderInterface
public
mixed
setResponder( Peridot\Leo\Responder\ResponderInterface
$responder )
Set the ResponderInterface used by Leo.
Set the ResponderInterface used by Leo.
Parameters
- $responder
Returns
mixed
$this
public static
Peridot\Leo\Leo
instance( )
Singleton access to Leo. A singleton is used instead of a facade as PHP has some hangups about binding scope from static methods. This should be used to access all Assertion members.
Singleton access to Leo. A singleton is used instead of a facade as PHP has some hangups about binding scope from static methods. This should be used to access all Assertion members.
Returns
Code
$assertion = Leo::instance()->getAssertion(); $assertion->extend(function($assertion)) { $assertion->addMethod('coolAssertion', function($expected, $message = "") { $this->flag('message', $message); return new CoolMatcher($expected); }); });
Endcode
public static
Peridot\Leo\Assertion