public function getRunnerByMethod(\ReflectionMethod $method) { $class = new \ReflectionClass($method->class); $className = $class->name; if (!array_key_exists($className, $this->runnerMappings)) { return; } $methodName = $method->name; if (!array_key_exists($methodName, $this->runnerMappings[$className])) { return; } return $this->runnerMappings[$className][$methodName]; }
/** * {@inheritdoc} */ public function intercept(MethodInvocation $invocation) { $operation = new Callback(function () use($invocation) { return $invocation->proceed(); }); if (null === ($runner = $this->runnerRepository->getRunnerByMethod($invocation->reflection))) { return $operation->call(); } return $runner->run($operation); }