Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
func_get_args() can't be passed to methods in 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mlively committed Jan 26, 2015
1 parent d1e20eb commit a9913ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Phake/ClassGenerator/MockClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ protected function implementMethod(ReflectionMethod $method)
{
\$args = array();
{$this->copyMethodParameters($method)}
\$answer = \$this->__PHAKE_handlerChain->invoke(\$this, '{$method->getName()}', func_get_args(), \$args);
\$funcGetArgs = func_get_args();
\$answer = \$this->__PHAKE_handlerChain->invoke(\$this, '{$method->getName()}', \$funcGetArgs, \$args);
if (\$answer instanceof Phake_Stubber_Answers_IDelegator)
{
Expand Down Expand Up @@ -276,7 +277,7 @@ protected function generateMethodParameters(ReflectionMethod $method)
*/
protected function copyMethodParameters(ReflectionMethod $method)
{
$copies = "\$numArgs = count(func_get_args());\n\t\t";
$copies = "\$funcGetArgs = func_get_args();\n\t\t\$numArgs = count(\$funcGetArgs);\n\t\t";
foreach ($method->getParameters() as $parameter)
{
$pos = $parameter->getPosition();
Expand Down

0 comments on commit a9913ed

Please sign in to comment.