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
Namespace: Peridot\Leo
Package: Peridot\Leo
Located at Leo.php
Methods summary
public
Peridot\Leo\Assertion
|
#
getAssertion( )
Return the Leo Assertion.
Return the Leo Assertion.
Returns
|
public
mixed
|
#
setAssertion( mixed $assertion )
Set the Assertion used by Leo.
Set the Assertion used by Leo.
Parameters
Returns
mixed $this
|
public
Peridot\Leo\Formatter\FormatterInterface
|
#
getFormatter( )
Return the FormatterInterface used by Leo.
Return the FormatterInterface used by Leo.
Returns
|
public
mixed
|
|
public
Peridot\Leo\Responder\ResponderInterface
|
#
getResponder( )
Return the ResponderInterface being used by Leo.
Return the ResponderInterface being used by Leo.
Returns
|
public
mixed
|
|
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
|
#
assertion( )
Singleton access to Leo's assertion object.
Singleton access to Leo's assertion object.
Returns
|