RealtimeCompiler::getVirtualRoutes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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