PHP Class Eloquent\Phony\Matcher\MatcherFactory

Show file Open project: eloquent/phony Class Usage Examples

Public Methods

Method Description
__construct ( Eloquent\Phony\Matcher\Matcher $anyMatcher, WildcardMatcher $wildcardAnyMatcher, Eloquent\Phony\Exporter\Exporter $exporter ) Construct a new matcher factory.
adapt ( mixed $value ) : Eloquent\Phony\Matcher\Matcher Create a new matcher for the supplied value.
adaptAll ( array $values ) : array Create new matchers for the all supplied values.
addDefaultMatcherDrivers ( ) Add the default matcher drivers.
addMatcherDriver ( Eloquent\Phony\Matcher\MatcherDriver $driver ) Add a matcher driver.
any ( ) : Eloquent\Phony\Matcher\Matcher Create a new matcher that matches anything.
drivers ( ) : array Get the matcher drivers.
equalTo ( mixed $value, boolean $useSubstitution = false ) : Eloquent\Phony\Matcher\Matcher Create a new equal to matcher.
instance ( ) : MatcherFactory Get the static instance of this factory.
isMatcher ( mixed $value ) : boolean Returns true if the supplied value is a matcher.
wildcard ( mixed $value = null, integer $minimumArguments, integer | null $maximumArguments = null ) : WildcardMatcher Create a new matcher that matches multiple arguments.

Method Details

__construct() public method

Construct a new matcher factory.
public __construct ( Eloquent\Phony\Matcher\Matcher $anyMatcher, WildcardMatcher $wildcardAnyMatcher, Eloquent\Phony\Exporter\Exporter $exporter )
$anyMatcher Eloquent\Phony\Matcher\Matcher A matcher that matches any value.
$wildcardAnyMatcher WildcardMatcher A matcher that matches any number of arguments of any value.
$exporter Eloquent\Phony\Exporter\Exporter The exporter to use.

adapt() public method

Create a new matcher for the supplied value.
public adapt ( mixed $value ) : Eloquent\Phony\Matcher\Matcher
$value mixed The value to create a matcher for.
return Eloquent\Phony\Matcher\Matcher The newly created matcher.

adaptAll() public method

Create new matchers for the all supplied values.
public adaptAll ( array $values ) : array
$values array The values to create matchers for.
return array

addDefaultMatcherDrivers() public method

Add the default matcher drivers.

addMatcherDriver() public method

Add a matcher driver.
public addMatcherDriver ( Eloquent\Phony\Matcher\MatcherDriver $driver )
$driver Eloquent\Phony\Matcher\MatcherDriver The matcher driver.

any() public method

Create a new matcher that matches anything.
public any ( ) : Eloquent\Phony\Matcher\Matcher
return Eloquent\Phony\Matcher\Matcher The newly created matcher.

drivers() public method

Get the matcher drivers.
public drivers ( ) : array
return array

equalTo() public method

Create a new equal to matcher.
public equalTo ( mixed $value, boolean $useSubstitution = false ) : Eloquent\Phony\Matcher\Matcher
$value mixed The value to check.
$useSubstitution boolean True to use substitution for wrapper types.
return Eloquent\Phony\Matcher\Matcher The newly created matcher.

instance() public static method

Get the static instance of this factory.
public static instance ( ) : MatcherFactory
return MatcherFactory The static factory.

isMatcher() public method

Returns true if the supplied value is a matcher.
public isMatcher ( mixed $value ) : boolean
$value mixed The value to test.
return boolean True if the value is a matcher.

wildcard() public method

Create a new matcher that matches multiple arguments.
public wildcard ( mixed $value = null, integer $minimumArguments, integer | null $maximumArguments = null ) : WildcardMatcher
$value mixed The value to check for each argument.
$minimumArguments integer The minimum number of arguments.
$maximumArguments integer | null The maximum number of arguments.
return WildcardMatcher The newly created wildcard matcher.