src/AppendSuffixVisitor.php
protected function appendSuffix(Name $class)
    {
        if ($class->isFullyQualified()) {
            if (count($class->parts) == 1) {
                return $class;
            }
            return $this->append(new Name('\\' . $class->toString()));
        }
        if ($this->isImport) {
            if (!$this->groupImport && count($class->parts) == 1) {
                return $class;
            }
            return $this->append($class);
        }
        foreach ($this->importNodes as $import) {
            if (strcmp($import->getLast(), $class->toString()) === 0) {
                return $class;
            }
        }
        return $this->append($class);
    }
protected function appendSuffix(Name $class)
    {
        if ($class->isFullyQualified()) {
            if (count($class->parts) == 1) {
                return $class;
            }
            return $this->append(new Name('\\' . $class->toString()));
        }
        if ($this->isImport) {
            if (!$this->groupImport && count($class->parts) == 1) {
                return $class;
            }
            return $this->append($class);
        }
        foreach ($this->importNodes as $import) {
            if (strcmp($import->getLast(), $class->toString()) === 0) {
                return $class;
            }
        }
        return $this->append($class);
    }
protected function appendSuffix ( Name $ class ) { if ( $ class -> isFullyQualified ( ) ) { if ( count ( $ class -> parts ) == 1 ) { return $ class ; } return $ this -> append ( new Name ( '\\' . $ class -> toString ( ) ) ) ; } if ( $ this -> isImport ) { if ( ! $ this -> groupImport && count ( $ class -> parts ) == 1 ) { return $ class ; } return $ this -> append ( $ class ) ; } foreach ( $ this -> importNodes as $ import ) { if ( strcmp ( $ import -> getLast ( ) , $ class -> toString ( ) ) === 0 ) { return $ class ; } } return $ this -> append ( $ class ) ; }
Append a suffix to the node.
@param  \PhpParse\Node\Name $class Name node
@return \PhpParse\Node\Name Appended node
Append a suffix to the node .