Overview

Namespaces

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

Classes

  • AbstractMatcher
  • CountableMatcher
  • EmptyMatcher
  • EqualMatcher
  • ExceptionMatcher
  • GreaterThanMatcher
  • GreaterThanOrEqualMatcher
  • InclusionMatcher
  • InstanceofMatcher
  • KeysMatcher
  • LengthMatcher
  • LessThanMatcher
  • LessThanOrEqualMatcher
  • Match
  • NullMatcher
  • PatternMatcher
  • PredicateMatcher
  • PropertyMatcher
  • RangeMatcher
  • SameMatcher
  • SubStringMatcher
  • TrueMatcher
  • TruthyMatcher
  • TypeMatcher

Interfaces

  • MatcherInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class AbstractMatcher

AbstractMatcher serves as the base for all Matchers.

Peridot\Leo\Matcher\AbstractMatcher implements Peridot\Leo\Matcher\MatcherInterface

Direct known subclasses

Peridot\Leo\Matcher\CountableMatcher, Peridot\Leo\Matcher\EmptyMatcher, Peridot\Leo\Matcher\PredicateMatcher, Peridot\Leo\Matcher\PropertyMatcher, Peridot\Leo\Matcher\SameMatcher, Peridot\Leo\Matcher\SubStringMatcher, Peridot\Leo\Matcher\TrueMatcher, Peridot\Leo\Matcher\TruthyMatcher, Peridot\Leo\Matcher\TypeMatcher, Peridot\Leo\Matcher\EqualMatcher, Peridot\Leo\Matcher\ExceptionMatcher, Peridot\Leo\Matcher\InclusionMatcher, Peridot\Leo\Matcher\InstanceofMatcher, Peridot\Leo\Matcher\KeysMatcher, Peridot\Leo\Matcher\LengthMatcher, Peridot\Leo\Matcher\NullMatcher, Peridot\Leo\Matcher\PatternMatcher

Indirect known subclasses

Peridot\Leo\Matcher\GreaterThanMatcher, Peridot\Leo\Matcher\GreaterThanOrEqualMatcher, Peridot\Leo\Matcher\LessThanMatcher, Peridot\Leo\Matcher\LessThanOrEqualMatcher, Peridot\Leo\Matcher\RangeMatcher
Abstract
Namespace: Peridot\Leo\Matcher
Package: Peridot\Leo\Matcher
Located at Matcher/AbstractMatcher.php
Methods summary
public
# __construct( mixed $expected )

Parameters

$expected
public boolean
# isNegated( )

Returns whether or not the matcher is negated. A negated matcher negates the results of a match.

Returns whether or not the matcher is negated. A negated matcher negates the results of a match.

Returns

boolean

Implementation of

Peridot\Leo\Matcher\MatcherInterface::isNegated()
public mixed
# invert( )

Inverts a matcher. If a matcher is not negated, it will become negated. If a matcher is negated, it will no longer be negated.

Inverts a matcher. If a matcher is not negated, it will become negated. If a matcher is negated, it will no longer be negated.

Returns

mixed
$this

Implementation of

Peridot\Leo\Matcher\MatcherInterface::invert()
public Peridot\Leo\Matcher\Match
# match( mixed $actual = "" )

Perform a match against an actual value.

Perform a match against an actual value.

Parameters

$actual

Returns

Peridot\Leo\Matcher\Match

Implementation of

Peridot\Leo\Matcher\MatcherInterface::match()
public Peridot\Leo\Matcher\Template\TemplateInterface
# getTemplate( )

Return the TemplateInterface being used by the matcher.

Return the TemplateInterface being used by the matcher.

Returns

Peridot\Leo\Matcher\Template\TemplateInterface

Implementation of

Peridot\Leo\Matcher\MatcherInterface::getTemplate()
public mixed
# setTemplate( Peridot\Leo\Matcher\Template\TemplateInterface $template )

Set the TemplateInterface to use for formatting match results.

Set the TemplateInterface to use for formatting match results.

Parameters

$template

Returns

mixed
$this

Implementation of

Peridot\Leo\Matcher\MatcherInterface::setTemplate()
public mixed
# setAssertion( Peridot\Leo\Assertion $assertion )

Set the Assertion bound to the matcher. Useful for checking flags from within a matcher.

Set the Assertion bound to the matcher. Useful for checking flags from within a matcher.

Parameters

$assertion

Returns

mixed
$this

Implementation of

Peridot\Leo\Matcher\MatcherInterface::setAssertion()
abstract protected boolean
# doMatch( mixed $actual )

The actual matching algorithm for the matcher. This is called by ->match() to create a Match result.

The actual matching algorithm for the matcher. This is called by ->match() to create a Match result.

Parameters

$actual

Returns

boolean
Methods inherited from Peridot\Leo\Matcher\MatcherInterface
getDefaultTemplate()
Properties summary
protected mixed $expected
#
protected boolean $negated
# false
protected Peridot\Leo\Matcher\Template\TemplateInterface $template
#
protected Peridot\Leo\Assertion $assertion
#
Leo API documentation generated by ApiGen