Skip to content

Commit

Permalink
Refactor library/Mockery/ClosureWrapper.php (#1362)
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Feb 29, 2024
2 parents 4ef359c + 8404a47 commit 1650707
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions library/Mockery/ClosureWrapper.php
Expand Up @@ -10,7 +10,7 @@

namespace Mockery;

use Mockery\Matcher\Closure;
use Closure;

/**
* @internal
Expand All @@ -19,13 +19,16 @@ class ClosureWrapper
{
private $closure;

public function __construct(\Closure $closure)
public function __construct(Closure $closure)
{
$this->closure = $closure;
}

/**
* @return mixed
*/
public function __invoke()
{
return call_user_func_array($this->closure, func_get_args());
return ($this->closure)(...func_get_args());
}
}

0 comments on commit 1650707

Please sign in to comment.