Skip to content

Instantly share code, notes, and snippets.

@ScreamingDev
Created April 28, 2013 18:05
Show Gist options
  • Save ScreamingDev/5477772 to your computer and use it in GitHub Desktop.
Save ScreamingDev/5477772 to your computer and use it in GitHub Desktop.
$methodName = $this->getName();
foreach ($this->getParameters() as $param)
{ /** @var \ReflectionParameter $param Iterate over possible params */
$currentParam = '';
if ($param->isPassedByReference())
{
$currentParam = '&';
}
$currentParam .= '$' . $param->getName();
if ($param->isOptional())
{
if ($param->isDefaultValueAvailable())
{
$currentParam .= ' = ' . $param->getDefaultValue();
}
elseif ($param->isDefaultValueConstant())
{
$currentParam .= ' = ' . $param->getDefaultValueConstantName();
}
}
$paramSet[] = $currentParam;
}
$this->_signature = join(', ', $paramSet);
return $this->_signature;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment