public function getParameterByName($name) {
    $name = ltrim($name, '$');
    /** @var ParameterNode $parameter */
    foreach ($this->getParameters()->reverse() as $parameter) {
      if ($parameter->getName() === $name) {
        return $parameter;
      }
    }
    throw new \UnexpectedValueException("Parameter {$name} does not exist.");
  }
public function getParameterByName($name) {
    $name = ltrim($name, '$');
    /** @var ParameterNode $parameter */
    foreach ($this->getParameters()->reverse() as $parameter) {
      if ($parameter->getName() === $name) {
        return $parameter;
      }
    }
    throw new \UnexpectedValueException("Parameter {$name} does not exist.");
  }
public function getParameterByName ( $ name ) { $ name = ltrim ( $ name , '$' ) ; /** @var ParameterNode $parameter */ foreach ( $ this -> getParameters ( ) -> reverse ( ) as $ parameter ) { if ( $ parameter -> getName ( ) === $ name ) { return $ parameter ; } } throw new \ UnexpectedValueException ( "Parameter {$name} does not exist." ) ; }
Gets a parameter by its name.

@param string $name
The parameter name with or without leading $.

@return ParameterNode

@throws \UnexpectedValueException if the named parameter doesn't exist.
Gets a parameter by its name .