PHP Class kahlan\Arg

Show file Open project: crysalead/kahlan Class Usage Examples

Protected Properties

Property Type Description
$_args array The expected arguments.
$_classes array Class dependencies.
$_matchers array The array of fully namespaced matcher classname.
$_name string The matcher name.
$_not boolean If true, the result of the test will be inverted.

Public Methods

Method Description
__callStatic ( string $name, array $args ) : boolean Create an Argument Matcher
__construct ( array $config = [] ) Constructor
match ( $actual ) : boolean Check if $actual matches the matcher.

Method Details

__callStatic() public static method

Create an Argument Matcher
public static __callStatic ( string $name, array $args ) : boolean
$name string The name of the matcher.
$args array The arguments to pass to the matcher.
return boolean

__construct() public method

Constructor
public __construct ( array $config = [] )
$config array The argument matcher options. Possible values are: - `'not'` _boolean_: indicate if the matcher is a negative matcher. - `'matcher'` _string_ : the fully namespaced matcher class name. - `'args'` _string_ : the expected arcuments.

match() public method

Check if $actual matches the matcher.
public match ( $actual ) : boolean
return boolean Returns `true` on success and `false` otherwise.

Property Details

$_args protected property

The expected arguments.
protected array $_args
return array

$_classes protected static property

Class dependencies.
protected static array $_classes
return array

$_matchers protected property

The array of fully namespaced matcher classname.
protected array $_matchers
return array

$_name protected property

The matcher name.
protected string $_name
return string

$_not protected property

If true, the result of the test will be inverted.
protected bool $_not
return boolean