Skip to content

Commit

Permalink
Merge pull request #290 from cbandy/patch-1
Browse files Browse the repository at this point in the history
Include reference modifier only for method definition.
  • Loading branch information
sebastianbergmann committed Aug 25, 2011
2 parents f53dcf0 + e4144b0 commit 83dd534
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions PHPUnit/Util/Class.php
Expand Up @@ -147,6 +147,7 @@ public static function getMethodParameters($method, $forCall = FALSE)
}

$default = '';
$reference = '';
$typeHint = '';

if (!$forCall) {
Expand All @@ -170,19 +171,16 @@ public static function getMethodParameters($method, $forCall = FALSE)
$value = $parameter->getDefaultValue();
$default = ' = ' . var_export($value, TRUE);
}

else if ($parameter->isOptional()) {
$default = ' = null';
}
}

$ref = '';

if ($parameter->isPassedByReference()) {
$ref = '&';
if ($parameter->isPassedByReference()) {
$reference = '&';
}
}

$parameters[] = $typeHint . $ref . $name . $default;
$parameters[] = $typeHint . $reference . $name . $default;
}

return join(', ', $parameters);
Expand Down

0 comments on commit 83dd534

Please sign in to comment.