Pagekit\Routing\Event\RouterListener::__construct PHP Method

__construct() public method

Constructor.
public __construct ( Symfony\Component\Routing\Matcher\UrlMatcherInterface | Symfony\Component\Routing\Matcher\RequestMatcherInterface $matcher, Psr\Log\LoggerInterface $logger = null )
$matcher Symfony\Component\Routing\Matcher\UrlMatcherInterface | Symfony\Component\Routing\Matcher\RequestMatcherInterface
$logger Psr\Log\LoggerInterface
    public function __construct($matcher, LoggerInterface $logger = null)
    {
        if (!$matcher instanceof UrlMatcherInterface && !$matcher instanceof RequestMatcherInterface) {
            throw new \InvalidArgumentException('Matcher must either implement UrlMatcherInterface or RequestMatcherInterface.');
        }
        $this->matcher = $matcher;
        $this->logger = $logger;
    }