/** * {@inheritdoc} */ public function locate($nameOfMessage) { if (!$this->handlers->containsKey($nameOfMessage)) { throw NotFoundException::handlerFor($nameOfMessage); } return $this->handlers->get($nameOfMessage); }
/** * Test handlerFor method. */ public function testHandlerFor() { $this->given($exception = NotFoundException::handlerFor('bar'))->then()->variable($exception->getPrevious())->isNull(); }