/** * Parses a trait method reference and returns the found reference as an * <b>array</b>. * * The returned array with contain only one element, when the referenced * method is specified by the method's name, without the declaring trait. * When the method reference contains the declaring trait the returned * <b>array</b> will contain two elements. The first element is the plain * method name and the second element is an instance of the * {@link PHP_Depend_Code_ASTTraitReference} class that represents the * declaring trait. * * @return array * @since 1.0.0 */ private function parseTraitMethodReference() { $this->tokenStack->push(); $qualifiedName = $this->parseQualifiedName(); $this->consumeComments(); if (self::T_DOUBLE_COLON === $this->tokenizer->peek()) { $traitReference = $this->setNodePositionsAndReturn($this->builder->buildAstTraitReference($qualifiedName)); $this->consumeToken(self::T_DOUBLE_COLON); $this->consumeComments(); return array($this->parseFunctionName(), $traitReference); } $this->tokenStack->pop(); return array($qualifiedName); }