RealtimeCompiler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerVirtualRoute() 0 3 1
A getVirtualRoutes() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\RealtimeCompiler;
6
7
use Desilva\Microserve\Response;
8
9
/**
10
 * @public This class is part of the public API and is covered by the backward compatibility promise.
11
 */
12
class RealtimeCompiler
13
{
14
    /** @var array<string, callable(\Desilva\Microserve\Request): Response> */
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<string, callable(\...rve\Request): Response> at position 4 could not be parsed: Expected '>' at position 4, but found 'callable'.
Loading history...
15
    protected array $virtualRoutes = [];
16
17
    /** @param callable(\Desilva\Microserve\Request): Response $route */
18
    public function registerVirtualRoute(string $uri, callable $route): void
19
    {
20
        $this->virtualRoutes[$uri] = $route;
21
    }
22
23
    /** @return array<string, callable(\Desilva\Microserve\Request): Response> */
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<string, callable(\...rve\Request): Response> at position 4 could not be parsed: Expected '>' at position 4, but found 'callable'.
Loading history...
24
    public function getVirtualRoutes(): array
25
    {
26
        return $this->virtualRoutes;
27
    }
28
}
29