Menu

## NodeFinder
in package

NodeFinder.php : 8

### Table of Contents

find() : array<string|int, Node>
  Find all nodes satisfying a filter callback.
findFirst() : null|Node
  Find first node satisfying a filter callback.
findFirstInstanceOf() : null|Node
  Find first node that is an instance of a certain class.
findInstanceOf() : array<string|int, Node>
  Find all nodes that are instances of a certain class.

### Methods

#### find()

NodeFinder.php : 18

Find all nodes satisfying a filter callback.

`public find(Node|array<string|int, Node> $nodes, callable $filter) : array<string|int, Node>`

##### Parameters

$nodes : Node|array<string|int, Node>

  Single node or array of nodes to search in

$filter : callable

  Filter callback: function(Node $node) : bool

##### Return values

array<string|int, Node> —

Found nodes satisfying the filter callback

#### findFirst()

NodeFinder.php : 54

Find first node satisfying a filter callback.

`public findFirst(Node|array<string|int, Node> $nodes, callable $filter) : null|Node`

##### Parameters

$nodes : Node|array<string|int, Node>

  Single node or array of nodes to search in

$filter : callable

  Filter callback: function(Node $node) : bool

##### Return values

null|Node —

Found node (or null if none found)

#### findFirstInstanceOf()

NodeFinder.php : 76

Find first node that is an instance of a certain class.

`public findFirstInstanceOf(Node|array<string|int, Node> $nodes, string $class) : null|Node`

##### Parameters

$nodes : Node|array<string|int, Node>

  Single node or array of nodes to search in

$class : string

  Class name

##### Return values

null|Node —

Found node, which is an instance of $class (or null if none found)

#### findInstanceOf()

NodeFinder.php : 40

Find all nodes that are instances of a certain class.

`public findInstanceOf(Node|array<string|int, Node> $nodes, string $class) : array<string|int, Node>`

##### Parameters

$nodes : Node|array<string|int, Node>

  Single node or array of nodes to search in

$class : string

  Class name

##### Return values

array<string|int, Node> —

Found nodes (all instances of $class)

## Search results