Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function resolve(MessageInterface $message)
 {
     $nameOfMessage = $this->nameOfMessageResolver->resolve($message);
     $handler = $this->getHandlerFor($nameOfMessage);
     $handlerMethodName = $this->getHandlerMethodFor($nameOfMessage);
     if (!method_exists($handler, $handlerMethodName)) {
         throw NotFoundException::methodForObject($handler, $handlerMethodName);
     }
     return Delegate::fromMethod($handler, $handlerMethodName);
 }
Exemplo n.º 2
0
 /**
  * Test methodForObject method.
  */
 public function testMethodForObject()
 {
     $this->given($exception = NotFoundException::methodForObject('foo', 'bar'))->then()->variable($exception->getPrevious())->isNull();
 }