You are here

private function ProxyGenerator::buildParametersString in Plug 7

Parameters

ClassMetadata $class:

\ReflectionMethod $method:

\ReflectionParameter[] $parameters:

Return value

string

1 call to ProxyGenerator::buildParametersString()
ProxyGenerator::generateMethods in lib/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php
Generates decorated methods by picking those available in the parent class.

File

lib/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php, line 894

Class

ProxyGenerator
This factory is used to generate proxy classes. It builds proxies from given parameters, a template and class metadata.

Namespace

Doctrine\Common\Proxy

Code

private function buildParametersString(ClassMetadata $class, \ReflectionMethod $method, array $parameters) {
  $parameterDefinitions = array();

  /* @var $param \ReflectionParameter */
  foreach ($parameters as $param) {
    $parameterDefinition = '';
    if ($parameterType = $this
      ->getParameterType($class, $method, $param)) {
      $parameterDefinition .= $parameterType . ' ';
    }
    if ($param
      ->isPassedByReference()) {
      $parameterDefinition .= '&';
    }
    if (method_exists($param, 'isVariadic')) {
      if ($param
        ->isVariadic()) {
        $parameterDefinition .= '...';
      }
    }
    $parameters[] = '$' . $param
      ->getName();
    $parameterDefinition .= '$' . $param
      ->getName();
    if ($param
      ->isDefaultValueAvailable()) {
      $parameterDefinition .= ' = ' . var_export($param
        ->getDefaultValue(), true);
    }
    $parameterDefinitions[] = $parameterDefinition;
  }
  return implode(', ', $parameterDefinitions);
}