PHP Class FluentDOM\Constraints

Afficher le fichier Open project: fluentdom/fluentdom Class Usage Examples

Méthodes publiques

Méthode Description
assertNode ( mixed $node, string $message = 'DOMNode expected, got: %s.' ) : boolean
hasOption ( integer $options, integer $option ) : boolean Check options bitmask for an option
isCallable ( mixed $callback, boolean $allowGlobalFunctions = FALSE, boolean $silent = TRUE ) : callable | null check if parameter is a valid callback function. It returns the callable or NULL.
isNode ( mixed $node, boolean $ignoreTextNodes = FALSE ) : DOMElement | DOMText | DOMCdataSection Check if the DOMNode is DOMElement or DOMText with content.
isNodeList ( mixed $elements ) : Traversable | array Check if $elements is a traversable node list. It returns the $elements or NULL

Private Methods

Méthode Description
isCallableArray ( mixed $callback ) : boolean Return TRUE if the $callback is an array that can be an

Method Details

assertNode() public static méthode

public static assertNode ( mixed $node, string $message = 'DOMNode expected, got: %s.' ) : boolean
$node mixed
$message string
Résultat boolean

hasOption() public static méthode

Check options bitmask for an option
public static hasOption ( integer $options, integer $option ) : boolean
$options integer
$option integer
Résultat boolean

isCallable() public static méthode

If $silent is disabled, an exception is thrown for invalid callbacks
public static isCallable ( mixed $callback, boolean $allowGlobalFunctions = FALSE, boolean $silent = TRUE ) : callable | null
$callback mixed
$allowGlobalFunctions boolean
$silent boolean (no InvalidArgumentException)
Résultat callable | null

isNode() public static méthode

It returns the node or NULL.
public static isNode ( mixed $node, boolean $ignoreTextNodes = FALSE ) : DOMElement | DOMText | DOMCdataSection
$node mixed
$ignoreTextNodes boolean
Résultat DOMElement | DOMText | DOMCdataSection

isNodeList() public static méthode

Check if $elements is a traversable node list. It returns the $elements or NULL
public static isNodeList ( mixed $elements ) : Traversable | array
$elements mixed
Résultat Traversable | array