PhpMigration\Changes\v5dot3\IncompByReference::emitSpot PHP Method

emitSpot() protected method

protected emitSpot ( $call, $suspect = null )
    protected function emitSpot($call, $suspect = null)
    {
        /**
         * {Description}
         * The behaviour of functions with by-reference parameters called by
         * value has changed. Where previously the function would accept the
         * by-value argument, a fatal error is now emitted. Any previous code
         * passing constants or literals to functions expecting references,
         * will need altering to assign the value to a variable before calling
         * the function.
         *
         * {Errmsg}
         * Fatal error: Only variables can be passed by reference
         *
         * {Reference}
         * http://php.net/manual/en/migration53.incompatible.php
         */
        if ($suspect) {
            $message = 'Only variables can be passed by reference, when %s called by instance %s';
            $message = sprintf($message, $call['name'], implode(', ', $suspect));
            $cate = 'WARNING';
            $certain = false;
        } else {
            $message = 'Only variables can be passed by reference';
            $cate = 'FATAL';
            $certain = true;
        }
        $this->addSpot($cate, $certain, $message, $call['line'], $call['file']);
    }