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 CountableMatcher

CountableMatcher a matcher is a matcher that matches numeric values, or reduces a countable value - like array, string, or Countable - to a single numeric value.

Peridot\Leo\Matcher\AbstractMatcher implements Peridot\Leo\Matcher\MatcherInterface
Extended by Peridot\Leo\Matcher\CountableMatcher

Direct 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/CountableMatcher.php
Methods summary
public mixed
# setCountable( mixed $countable )

Set the countable value used by the CountableMatcher.

Set the countable value used by the CountableMatcher.

Parameters

$countable

Returns

mixed
$this
public mixed
# getCountable( )

Return the countable used by the CountableMatcher.

Return the countable used by the CountableMatcher.

Returns

mixed
public integer
# getCount( )

Get the count of the countable value.

Get the count of the countable value.

Returns

integer
public Peridot\Leo\Matcher\Template\TemplateInterface
# getTemplate( )

Return the TemplateInterface being used by the matcher.

Return the TemplateInterface being used by the matcher.

Returns a default countable interface if the countable is set.

Returns

Peridot\Leo\Matcher\Template\TemplateInterface

Overrides

Peridot\Leo\Matcher\AbstractMatcher::getTemplate()
protected mixed
# doMatch( mixed $actual = null )

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

mixed
abstract public Peridot\Leo\Matcher\Template\TemplateInterface
# getDefaultCountableTemplate( )

Return a default template for when a countable has been set.

Return a default template for when a countable has been set.

Returns

Peridot\Leo\Matcher\Template\TemplateInterface
abstract protected boolean
# matchNumeric( mixed $number )

Determine if a number matches a specified condition

Determine if a number matches a specified condition

Parameters

$number

Returns

boolean
Methods inherited from Peridot\Leo\Matcher\AbstractMatcher
__construct(), invert(), isNegated(), match(), setAssertion(), setTemplate()
Methods inherited from Peridot\Leo\Matcher\MatcherInterface
getDefaultTemplate()
Properties summary
protected mixed $countable
#
Properties inherited from Peridot\Leo\Matcher\AbstractMatcher
$assertion, $expected, $negated, $template
Leo API documentation generated by ApiGen