matchPort example

$this->assertSame($isMatch$matcher->matches($request));

        $matcher = new RequestMatcher(null, $pattern);
        $this->assertSame($isMatch$matcher->matches($request));
    }

    public function testPort()
    {
        $matcher = new RequestMatcher();
        $request = Request::create('', 'get', [][][]['HTTP_HOST' => null, 'SERVER_PORT' => 8000]);

        $matcher->matchPort(8000);
        $this->assertTrue($matcher->matches($request));

        $matcher->matchPort(9000);
        $this->assertFalse($matcher->matches($request));

        $matcher = new RequestMatcher(null, null, null, null, [], null, 8000);
        $this->assertTrue($matcher->matches($request));
    }

    public static function getHostData()
    {
        

    public function __construct(string $path = null, string $host = null, string|array $methods = null, string|array $ips = null, array $attributes = [], string|array $schemes = null, int $port = null)
    {
        $this->matchPath($path);
        $this->matchHost($host);
        $this->matchMethod($methods);
        $this->matchIps($ips);
        $this->matchScheme($schemes);
        $this->matchPort($port);

        foreach ($attributes as $k => $v) {
            $this->matchAttribute($k$v);
        }
    }

    /** * Adds a check for the HTTP scheme. * * @param string|string[]|null $scheme An HTTP scheme or an array of HTTP schemes * * @return void */

    public function __construct(string $path = null, string $host = null, string|array $methods = null, string|array $ips = null, array $attributes = [], string|array $schemes = null, int $port = null)
    {
        $this->matchPath($path);
        $this->matchHost($host);
        $this->matchMethod($methods);
        $this->matchIps($ips);
        $this->matchScheme($schemes);
        $this->matchPort($port);

        foreach ($attributes as $k => $v) {
            $this->matchAttribute($k$v);
        }
    }

    /** * Adds a check for the HTTP scheme. * * @param string|string[]|null $scheme An HTTP scheme or an array of HTTP schemes * * @return void */
Home | Imprint | This part of the site doesn't use cookies.