src/Argument.php
public function isPassedByReference()
    {
        if ($class = $this->reflection->getClass()
            and $class->isTrait()
        ) {
            return true;
        }
        if ($class = $this->reflection->getClass()) {
            $reflection = (new ReflectionClass($class))->getConstructor();
            foreach ($reflection->getParameters() as $param) {
                if (!$param->isDefaultValueAvailable()) {
                    return true;
                }
            }
            return false;
        }
        if ($this->reflection->isDefaultValueAvailable()) {
            return false;
        }
        // No default defined, but let's see if we can guess...
        if ($this->reflection->isArray()) {
            return false;
        }
        if (version_compare(phpversion(), '7.0', '>=')
            and $type = $this->reflection->getType()
        ) {
            return false;
        }
        if ($extracted = $this->extractParameterData()) {
            return false;
        }
        return true;
    }
public function isPassedByReference()
    {
        if ($class = $this->reflection->getClass()
            and $class->isTrait()
        ) {
            return true;
        }
        if ($class = $this->reflection->getClass()) {
            $reflection = (new ReflectionClass($class))->getConstructor();
            foreach ($reflection->getParameters() as $param) {
                if (!$param->isDefaultValueAvailable()) {
                    return true;
                }
            }
            return false;
        }
        if ($this->reflection->isDefaultValueAvailable()) {
            return false;
        }
        // No default defined, but let's see if we can guess...
        if ($this->reflection->isArray()) {
            return false;
        }
        if (version_compare(phpversion(), '7.0', '>=')
            and $type = $this->reflection->getType()
        ) {
            return false;
        }
        if ($extracted = $this->extractParameterData()) {
            return false;
        }
        return true;
    }
public function isPassedByReference ( ) { if ( $ class = $ this -> reflection -> getClass ( ) and $ class -> isTrait ( ) ) { return true ; } if ( $ class = $ this -> reflection -> getClass ( ) ) { $ reflection = ( new ReflectionClass ( $ class ) ) -> getConstructor ( ) ; foreach ( $ reflection -> getParameters ( ) as $ param ) { if ( ! $ param -> isDefaultValueAvailable ( ) ) { return true ; } } return false ; } if ( $ this -> reflection -> isDefaultValueAvailable ( ) ) { return false ; } // No default defined, but let's see if we can guess... if ( $ this -> reflection -> isArray ( ) ) { return false ; } if ( version_compare ( phpversion ( ) , '7.0' , '>=' ) and $ type = $ this -> reflection -> getType ( ) ) { return false ; } if ( $ extracted = $ this -> extractParameterData ( ) ) { return false ; } return true ; }
Guesstimate if the argument should be passed by reference. This is true
for objects with constructor parameters without defaults, as well as
other non-guessable defaults.

@return bool
Guesstimate if the argument should be passed by reference . This is true for objects with constructor parameters without defaults as well as other non - guessable defaults .