PhpMigration\Changes\v5dot4\IncompParamName::leaveNode PHP Method

leaveNode() public method

public leaveNode ( $node )
    public function leaveNode($node)
    {
        /**
         * {Description}
         * Parameter names that shadow super globals now cause a fatal error.
         * This prohibits code like function foo($_GET, $_POST) {}.
         *
         * {Errmsg}
         * Fatal error: Cannot re-assign auto-global variable
         * Fatal error: Cannot re-assign $this
         *
         * {Reference}
         * http://php.net/manual/en/migration54.incompatible.php
         */
        if (($node instanceof Stmt\Function_ || $node instanceof Stmt\ClassMethod) && $this->hasParamShadowGlobal($node)) {
            $this->addSpot('FATAL', true, 'Cannot re-assign auto-global variable');
        }
    }