BetterReflection\Reflection\ReflectionParameter::__toString PHP Метод

__toString() публичный Метод

Return string representation of this parameter.
public __toString ( ) : string
Результат string
    public function __toString()
    {
        $isNullableObjectParam = $this->getTypeHint() && $this->getTypeHint() instanceof Types\Object_ && $this->isOptional();
        return sprintf('Parameter #%d [ %s %s%s%s%s$%s%s ]', $this->parameterIndex, $this->isVariadic() || $this->isOptional() ? '<optional>' : '<required>', $this->getTypeHint() ? ltrim($this->getTypeHint()->__toString(), '\\') . ' ' : '', $isNullableObjectParam ? 'or NULL ' : '', $this->isVariadic() ? '...' : '', $this->isPassedByReference() ? '&' : '', $this->getName(), $this->isOptional() && $this->isDefaultValueAvailable() ? ' = ' . $this->getDefaultValueAsString() : '');
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function __toString()
 {
     return $this->betterReflectionParameter->__toString();
 }