src/ReflectionFileNamespace.php
public function getLastTokenPosition()
    {
        $endNamespaceTokenPosition = $this->namespaceNode->getAttribute('endTokenPos');

        /** @var Node $lastNamespaceNode */
        $lastNamespaceNode         = end($this->namespaceNode->stmts);
        $endStatementTokenPosition = $lastNamespaceNode->getAttribute('endTokenPos');

        return max($endNamespaceTokenPosition, $endStatementTokenPosition);
    }
public function getLastTokenPosition()
    {
        $endNamespaceTokenPosition = $this->namespaceNode->getAttribute('endTokenPos');

        /** @var Node $lastNamespaceNode */
        $lastNamespaceNode         = end($this->namespaceNode->stmts);
        $endStatementTokenPosition = $lastNamespaceNode->getAttribute('endTokenPos');

        return max($endNamespaceTokenPosition, $endStatementTokenPosition);
    }
public function getLastTokenPosition ( ) { $ endNamespaceTokenPosition = $ this -> namespaceNode -> getAttribute ( 'endTokenPos' ) ; /** @var Node $lastNamespaceNode */ $ lastNamespaceNode = end ( $ this -> namespaceNode -> stmts ) ; $ endStatementTokenPosition = $ lastNamespaceNode -> getAttribute ( 'endTokenPos' ) ; return max ( $ endNamespaceTokenPosition , $ endStatementTokenPosition ) ; }
Helper method to access last token position for namespace

This method is useful because namespace can be declared with braces or without them
Helper method to access last token position for namespace