src/Reflection/ReflectionClass.php
public function getShortName() : string
    {
        if (! $this->isAnonymous()) {
            /** @var Node\Identifier $this->node->name */
            return $this->node->name->name;
        }

        $fileName = $this->getFileName();

        if ($fileName === null) {
            $fileName = sha1($this->locatedSource->getSource());
        }

        return sprintf('%s%c%s(%d)', self::ANONYMOUS_CLASS_NAME_PREFIX, "\0", $fileName, $this->getStartLine());
    }
public function getShortName() : string
    {
        if (! $this->isAnonymous()) {
            /** @var Node\Identifier $this->node->name */
            return $this->node->name->name;
        }

        $fileName = $this->getFileName();

        if ($fileName === null) {
            $fileName = sha1($this->locatedSource->getSource());
        }

        return sprintf('%s%c%s(%d)', self::ANONYMOUS_CLASS_NAME_PREFIX, "\0", $fileName, $this->getStartLine());
    }
Get the "short" name of the class (e.g. for A\B\Foo, this will return
"Foo").