for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Go! AOP framework
*
* @copyright Copyright 2015, Lisachenko Alexander <[email protected]>
* This source file is subject to the license that is bundled
* with this source code in the file LICENSE.
*/
namespace Go\Aop\Framework;
class DynamicClosureSplatMethodInvocation extends DynamicClosureMethodInvocation
{
/**
* Invokes original method and return result from it
* @return mixed
public function proceed()
if (isset($this->advices[$this->current])) {
/** @var $currentInterceptor \Go\Aop\Intercept\Interceptor */
$currentInterceptor = $this->advices[$this->current++];
return $currentInterceptor->invoke($this);
}
// Fill the closure only once if it's empty
if (!$this->closureToCall) {
$this->closureToCall = $this->reflectionMethod->getClosure($this->instance);
// Rebind the closure if instance was changed since last time
if ($this->previousInstance !== $this->instance) {
$this->closureToCall = $this->closureToCall->bindTo($this->instance, $this->reflectionMethod->class);
$this->previousInstance = $this->instance;
$closureToCall = $this->closureToCall;
return $closureToCall(...$this->arguments);