<?php

namespace Roave\BetterReflection\NodeCompiler;

use PhpParser\Node;

class FourthClass
{
    /**
     * @var Node\Stmt\ClassMethod|Node\Stmt\Function_|Node\Expr\Closure
     */
    private $node;

    /**
     * Get the "short" name of the function (e.g. for A\B\foo, this will return
     * "foo").
     *
     * @return string
     */
    public function getShortName() : string
    {
        if ($this->node instanceof Node\Expr\Closure) {
            return self::CLOSURE_NAME;
        }

        return $this->node->name;
    }
}

?>
-----
<?php

namespace Roave\BetterReflection\NodeCompiler;

use PhpParser\Node;

class FourthClass
{
    /**
     * @var Node\Stmt\ClassMethod|Node\Stmt\Function_|Node\Expr\Closure
     */
    private $node;

    /**
     * Get the "short" name of the function (e.g. for A\B\foo, this will return
     * "foo").
     *
     * @return string
     */
    public function getShortName() : string
    {
        if ($this->node instanceof Node\Expr\Closure) {
            return self::CLOSURE_NAME;
        }

        return $this->node->name->toString();
    }
}

?>
