Пример #1
0
 /**
  * @param ServiceResolveEvent $event
  */
 public function onAfterResolve(ServiceResolveEvent $event)
 {
     if (!$this->stopwatch) {
         return;
     }
     $this->stopwatch->stop('resolve ' . $event->getDirectRequest()->getRequestKey());
 }
 /**
  * @param ServiceResolveEvent $event
  */
 public function onAfterResolve(ServiceResolveEvent $event)
 {
     try {
         $this->validator->validate($event->getService(), $event->getArguments());
     } catch (ArgumentValidationException $e) {
         if ($e->isStrictFailure()) {
             throw $e;
         }
         $event->setArguments(array_replace($event->getArguments(), ['__internal__validation_result__' => $e->getResult()]));
     }
 }
 /**
  * @param ServiceResolveEvent $event
  */
 public function onAfterResolve(ServiceResolveEvent $event)
 {
     $event->setArguments($this->converter->convert($event->getService(), $event->getArguments()));
 }
Пример #4
0
 /**
  * @param ServiceResolveEvent $event
  */
 public function onAfterResolve(ServiceResolveEvent $event)
 {
     if (!$this->authorizationChecker->isGranted($event->getService(), $event->getArguments())) {
         throw new NotAuthorizedException();
     }
 }