Overview

Namespaces

  • None
  • Peridot
    • Leo
      • Formatter
      • Interfaces
        • Assert
      • Matcher
        • Template
      • ObjectPath
      • Responder
  • PHP

Classes

  • Assertion
  • Leo

Traits

  • DynamicObjectTrait
  • Overview
  • Namespace
  • Class
  • Tree

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

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
# getFormatter( )

Return the FormatterInterface used by Leo.

Return the FormatterInterface used by Leo.

Returns

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
# getResponder( )

Return the ResponderInterface being used by Leo.

Return the ResponderInterface being used by Leo.

Returns

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

Peridot\Leo\Leo

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

Peridot\Leo\Assertion
Properties summary
protected Peridot\Leo\Formatter\Formatter $formatter
#
protected Peridot\Leo\Responder\ExceptionResponder $responder
#
protected Peridot\Leo\Assertion $assertion
#
Leo API documentation generated by ApiGen