コード例 #1
0
 /**
  * @return boolean
  */
 public function __invoke(Node $node)
 {
     if ($node instanceof ArrayLookupNode) {
         $root = $node->getRootArray();
         if ($root instanceof ObjectPropertyNode) {
             $object = $root->getObject();
             if ($object instanceof VariableNode && $object->getName() == $this->variable) {
                 return sizeof($node->getKeys()) >= 3;
             }
         }
     }
     return FALSE;
 }
コード例 #2
0
ファイル: ArrayLookupNode.php プロジェクト: kidaa30/redcat
 /**
  * Returns the root of the lookup.
  *
  * For example, given an expression like $foo['bar']['baz'],
  * this method will return a VariableNode for $foo.
  *
  * @return Node
  */
 public function getRootArray()
 {
     return $this->array instanceof ArrayLookupNode ? $this->array->getRootArray() : $this->array;
 }