public function registerPseudoFilter($name, $object, $entity = "value")
    {
        if (is_callable($object)) {
            // user defined pseudo-filter
            $this->_pseudoFilters[$name] = array(
                "classname" => "CssParserFilterPseudoUserDefined",
                "user_def_function" => $object,
                "entity" => $entity
            );
        } else {
            $this->_pseudoFilters[$name] = array(
                "classname" => $object,
                "user_def_function" => null,
                "entity" => $entity
            );
        }
    }
public function registerPseudoFilter($name, $object, $entity = "value")
    {
        if (is_callable($object)) {
            // user defined pseudo-filter
            $this->_pseudoFilters[$name] = array(
                "classname" => "CssParserFilterPseudoUserDefined",
                "user_def_function" => $object,
                "entity" => $entity
            );
        } else {
            $this->_pseudoFilters[$name] = array(
                "classname" => $object,
                "user_def_function" => null,
                "entity" => $entity
            );
        }
    }
public function registerPseudoFilter ( $ name , $ object , $ entity = "value" ) { if ( is_callable ( $ object ) ) { // user defined pseudo-filter $ this -> _pseudoFilters [ $ name ] = array ( "classname" => "CssParserFilterPseudoUserDefined" , "user_def_function" => $ object , "entity" => $ entity ) ; } else { $ this -> _pseudoFilters [ $ name ] = array ( "classname" => $ object , "user_def_function" => null , "entity" => $ entity ) ; } }
Registers a new user defined pseudo-filter.

Example 1:
```php
// is the node in penultimate position?
$selector->registerPseudoFilter(
"penultimate", function ($node, $input, $position, $items
) {
return $position == count($items) - 2;
});
$items = $selector->query('item:penultimate');
```

Example 2:
```php
// is node position a Fibonacci number?
$css->registerPseudoFilter(
"fibonacci", function ($node, $input, $position, $items
) {
$isFibonacci = false;
if ($position > 0) {
$n = sqrt(5 * pow($position, 2) + 4);
$isFibonacci = $n - floor($n) == 0;
if (!$isFibonacci) {
$n = sqrt(5 * pow($position, 2) - 4);
$isFibonacci = $n - floor($n) == 0;
}
}
return $isFibonacci;
});
$items = $selector->query('item:fibonacci');
```

Example 3:
```php
// is the node position divisible by a given number?
$css->registerPseudoFilter(
"divisible", function ($node, $input, $position, $items
) {
$n = intval($input);
return $n > 0 && $position % $n == 0;
});

// selects all nodes 'divisible' by 3
$items = $selector->query('item:divisible(3)');
```

@param string         $name   Pseudo-filter name
@param string|Closure $object Class name or user defined function.
@param string         $entity Entity (default is 'value')

@return void
Registers a new user defined pseudo - filter .