protected function parseSelfReference(Token $token) { if ($this->classOrInterface === null) { throw new InvalidStateException($token->startLine, (string) $this->compilationUnit, 'The keyword "self" was used outside of a class/method scope.'); } $ref = $this->builder->buildAstSelfReference($this->classOrInterface); $ref->configureLinesAndColumns($token->startLine, $token->endLine, $token->startColumn, $token->endColumn); return $ref; }