PHP Class kahlan\Matcher

Show file Open project: crysalead/kahlan Class Usage Examples

Protected Properties

Property Type Description
$_classes array Class dependencies.
$_matchers array The matchers list

Public Methods

Method Description
exists ( string $name, string $target = '' ) : boolean Checks if a matcher is registered.
get ( string $name = null, string $target = '' ) : array Returns registered matchers.
register ( string $name, string $class, string $target = '' ) Registers a matcher.
reset ( ) Resets the class.
unregister ( mixed $name, string $target = '' ) Unregisters a matcher.

Method Details

exists() public static method

Checks if a matcher is registered.
public static exists ( string $name, string $target = '' ) : boolean
$name string The name of the matcher.
$target string An optional target class name.
return boolean Returns `true` if the matcher exists, `false` otherwise.

get() public static method

Returns registered matchers.
public static get ( string $name = null, string $target = '' ) : array
$name string The name of the matcher.
$target string An optionnal target class name.
return array The registered matchers or a fully-namespaced class name if $name is not null.

register() public static method

Registers a matcher.
public static register ( string $name, string $class, string $target = '' )
$name string The name of the matcher.
$class string A fully-namespaced class name.
$target string An optionnal target class name.

reset() public static method

Resets the class.
public static reset ( )

unregister() public static method

Unregisters a matcher.
public static unregister ( mixed $name, string $target = '' )
$name mixed The name of the matcher. If name is `true` unregister all the matchers.
$target string An optionnal target class name.

Property Details

$_classes protected property

Class dependencies.
protected array $_classes
return array

$_matchers protected static property

The matchers list
protected static array $_matchers
return array