/**
  * @throws InvalidRequestInfoImplementation
  */
 private function guardRequestInfoIsValid()
 {
     $requestInfo = $this->config->getRequestInfo();
     if (!$requestInfo instanceof ServesRequestInfo) {
         throw new InvalidRequestInfoImplementation();
     }
 }
Esempio n. 2
0
 /**
  * @param ServesUriComponents $uriComponents
  * @param ServesRequestData   $request
  *
  * @return HandlesDomainRequests
  */
 private function getDomainRequestHandler(ServesUriComponents $uriComponents, ServesRequestData $request)
 {
     $domainNamespace = $this->config->getDomainNamespace();
     $requestInfo = $this->config->getRequestInfo();
     $builder = new DomainRequestHandlerBuilder($domainNamespace, $requestInfo->getMethod(), $uriComponents);
     $domainRequestHandler = $builder->buildDomainRequestHandler($request);
     return $domainRequestHandler;
 }
 /**
  * @param ServesIceHawkConfig $config
  */
 public function __construct(ServesIceHawkConfig $config)
 {
     $this->requestInfo = $config->getRequestInfo();
     $this->uriResolver = $config->getUriResolver();
     $this->uriRewriter = $config->getUriRewriter();
     $this->eventListeners = $config->getEventListeners();
     $this->domainNamespace = $config->getDomainNamespace();
 }
Esempio n. 4
0
 /**
  * @param ServesIceHawkConfig $config
  * @param ControlsHandlingBehaviour $delegate
  */
 public function __construct(ServesIceHawkConfig $config, ControlsHandlingBehaviour $delegate)
 {
     $this->uriRewriter = $config->getUriRewriter();
     $this->uriResolver = $config->getUriResolver();
     $this->domainNamespace = $config->getDomainNamespace();
     $this->eventListeners = $config->getEventListeners();
     $this->requestInfo = $config->getRequestInfo();
     $this->delegate = $delegate;
 }