Kraken\Network\Http\Component\Router\HttpRouter::__construct PHP Method

__construct() public method

public __construct ( Kraken\Network\NetworkComponentAwareInterface $aware = null, mixed[] $params = [] )
$aware Kraken\Network\NetworkComponentAwareInterface
$params mixed[]
    public function __construct(NetworkComponentAwareInterface $aware = null, $params = [])
    {
        $this->routes = isset($params['routes']) && $params['routes'] instanceof RouteCollection ? $params['routes'] : new RouteCollection();
        $this->context = isset($params['context']) && $params['context'] instanceof RequestContext ? $params['context'] : new RequestContext();
        $this->matcher = new UrlMatcher($this->routes, $this->context);
        $this->host = isset($params['host']) ? $params['host'] : 'localhost';
        $this->checkOrigin = isset($params['checkOrigin']) ? $params['checkOrigin'] : false;
        $this->allowedOrigins = [];
        if ($aware !== null) {
            $aware->setComponent($this);
        }
    }