Class Filter
Factory for creating common callback filters.
Methods summary
public static
callable
|
#
any( callable[] $filters )
Callback returns true if any of the callbacks pass.
Callback returns true if any of the callbacks pass.
Parameters
Returns
callable
|
public static
callable
|
#
all( callable[] $filters )
Callback returns true if all of the callbacks pass.
Callback returns true if all of the callbacks pass.
Parameters
Returns
callable
|
public static
callable
|
#
isInstanceOf( string $class_name )
Callback to filter for nodes of certain types.
Callback to filter for nodes of certain types.
Parameters
- $class_name
...
At least one fully-qualified Pharborist node type to search for.
Returns
callable
|
public static
callable
|
#
isFunction( string $function_name )
Callback to filter for specific function declaration.
Callback to filter for specific function declaration.
Parameters
- $function_name
...
At least one function name to search for.
Returns
callable
|
public static
callable
|
#
isFunctionCall( string $function_name )
Callback to filter for calls to a function.
Callback to filter for calls to a function.
Parameters
- $function_name
...
At least one function name to search for.
Returns
callable
|
public static
callable
|
#
isClass( string $class_name )
Callback to filter for specific class declaration.
Callback to filter for specific class declaration.
Parameters
- $class_name
...
At least one class name to search for.
Returns
callable
|
public static
callable
|
#
isClassMethodCall( string $class_name, string $method_name )
Callback to filter for calls to a class method.
Callback to filter for calls to a class method.
Parameters
- $class_name
- Fully qualified class name or expression string.
- $method_name
- Method name or expression string.
Returns
callable Filter callable.
|
public static
callable
|
#
is( Pharborist\Node $match )
Callback to test if match to given node.
Callback to test if match to given node.
Parameters
Returns
callable
|
public static
callable
|
#
isTokenType( integer|string $type )
Callback to test if match to given token type.
Callback to test if match to given token type.
Parameters
Returns
callable
|
public static
callable
|
#
isNotHidden( )
Callback to skip whitespace and comments.
Callback to skip whitespace and comments.
Returns
callable
|
public static
callable
|
#
isNewline( )
Callback to match whitespace containing newlines.
Callback to match whitespace containing newlines.
Returns
callable
|