public function is($test) {
    if (is_callable($test)) {
      return (boolean) $test($this);
    }
    elseif (is_string($test)) {
      return $this->is(Filter::isInstanceOf($test));
    }
    else {
      throw new \InvalidArgumentException();
    }
  }
public function is($test) {
    if (is_callable($test)) {
      return (boolean) $test($this);
    }
    elseif (is_string($test)) {
      return $this->is(Filter::isInstanceOf($test));
    }
    else {
      throw new \InvalidArgumentException();
    }
  }
public function is ( $ test ) { if ( is_callable ( $ test ) ) { return ( boolean ) $ test ( $ this ) ; } elseif ( is_string ( $ test ) ) { return $ this -> is ( Filter :: isInstanceOf ( $ test ) ) ; } else { throw new \ InvalidArgumentException ( ) ; } }
Tests this node against a condition.

@param callable|string $test
Either a callback function to test the node against, or a class name
(wrapper around instanceof). Eventually this will accept a callable
or a filter query (issue #61).

@return boolean

@throws \InvalidArgumentException
Tests this node against a condition .