• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tempestphp / tempest-framework / 14049246919

24 Mar 2025 09:42PM UTC coverage: 79.353% (-0.04%) from 79.391%
14049246919

push

github

web-flow
feat(support): support array parameters in string manipulations (#1073)

48 of 48 new or added lines in 2 files covered. (100.0%)

735 existing lines in 126 files now uncovered.

10492 of 13222 relevant lines covered (79.35%)

90.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.62
/src/Tempest/Router/src/Routing/Matching/MatchingRegex.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Router\Routing\Matching;
6

7
use RuntimeException;
8
use Tempest\Router\Routing\Construction\MarkedRoute;
9

10
final readonly class MatchingRegex
11
{
12
    /**
13
     * @param string[] $patterns
14
     */
15
    public function __construct(
676✔
16
        public array $patterns,
17
    ) {}
676✔
18

19
    public function match(string $uri): ?RouteMatch
20✔
20
    {
21
        foreach ($this->patterns as $pattern) {
20✔
22
            $matchResult = preg_match($pattern, $uri, $matches);
19✔
23

24
            if ($matchResult === false) {
19✔
UNCOV
25
                throw new RuntimeException('Failed to use matching regex. Got error ' . preg_last_error());
×
26
            }
27

28
            if (! $matchResult) {
19✔
29
                continue;
8✔
30
            }
31

32
            if (! array_key_exists(MarkedRoute::REGEX_MARK_TOKEN, $matches)) {
14✔
UNCOV
33
                continue;
×
34
            }
35

36
            return RouteMatch::match($matches);
14✔
37
        }
38

39
        return null;
6✔
40
    }
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc