/** * Returns the root property. * * For example, given an expression like $foo->bar->baz this method will * return the identifier (T_STRING TokenNode) 'bar'. * * @return Node * The node for the root property. */ public function getRootProperty() { if ($this->object instanceof ObjectPropertyNode) { return $this->object->getRootProperty(); } else { return $this->property; } }