Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
8 / 8
CRAP
100.00% covered (success)
100.00%
1 / 1
RouteToken
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
8 / 8
8
100.00% covered (success)
100.00%
1 / 1
 __construct
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
 literal
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
 parameter
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
 remainder
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
 type
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
 value
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
 name
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
 constraint
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 Celema\Router;
6
7/** @internal */
8final readonly class RouteToken
9{
10    private function __construct(
11        private RouteTokenType $type,
12        private string $value = '',
13        private ?string $name = null,
14        private ?string $constraint = null,
15    ) {}
16
17    public static function literal(string $value): self
18    {
19        return new self(RouteTokenType::Literal, $value);
20    }
21
22    public static function parameter(string $name, ?string $constraint = null): self
23    {
24        return new self(RouteTokenType::Parameter, name: $name, constraint: $constraint);
25    }
26
27    public static function remainder(string $name): self
28    {
29        return new self(RouteTokenType::Remainder, name: $name);
30    }
31
32    public function type(): RouteTokenType
33    {
34        return $this->type;
35    }
36
37    public function value(): string
38    {
39        return $this->value;
40    }
41
42    public function name(): ?string
43    {
44        return $this->name;
45    }
46
47    public function constraint(): ?string
48    {
49        return $this->constraint;
50    }
51}

Branches

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

RouteToken->__construct
11        private RouteTokenType $type,
12        private string $value = '',
13        private ?string $name = null,
14        private ?string $constraint = null,
15    ) {}
RouteToken->constraint
49        return $this->constraint;
50    }
RouteToken->literal
17    public static function literal(string $value): self
18    {
19        return new self(RouteTokenType::Literal, $value);
20    }
RouteToken->name
44        return $this->name;
45    }
RouteToken->parameter
22    public static function parameter(string $name, ?string $constraint = null): self
23    {
24        return new self(RouteTokenType::Parameter, name: $name, constraint: $constraint);
25    }
RouteToken->remainder
27    public static function remainder(string $name): self
28    {
29        return new self(RouteTokenType::Remainder, name: $name);
30    }
RouteToken->type
34        return $this->type;
35    }
RouteToken->value
39        return $this->value;
40    }