Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
RouteMatch
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 route
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 params
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 method
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Celemas\Router;
6
7/** @psalm-api */
8final readonly class RouteMatch
9{
10    private Route $route;
11
12    /** @var array<string, string> */
13    private array $params;
14
15    private string $method;
16
17    /** @param array<string, string> $params */
18    public function __construct(Route $route, array $params, string $method)
19    {
20        $this->route = $route;
21        $this->params = $params;
22        $this->method = strtoupper($method);
23    }
24
25    public function route(): Route
26    {
27        return $this->route;
28    }
29
30    /** @return array<string, string> */
31    public function params(): array
32    {
33        return $this->params;
34    }
35
36    public function method(): string
37    {
38        return $this->method;
39    }
40}

Paths

Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once. Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

RouteMatch->__construct
18    public function __construct(Route $route, array $params, string $method)
19    {
20        $this->route = $route;
21        $this->params = $params;
22        $this->method = strtoupper($method);
23    }
RouteMatch->method
38        return $this->method;
39    }
RouteMatch->params
33        return $this->params;
34    }
RouteMatch->route
27        return $this->route;
28    }