Passed
Push — main ( 615377...62c5ea )
by Chema
54s queued 13s
created

RootRoutesPlugin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Config\Module\Plugin;
6
7
use Gacela\Router\Configure\Routes;
8
use Gacela\Router\RouterInterface;
9
use GacelaTest\Feature\Config\Module\Controller\HelloController;
10
11
final class RootRoutesPlugin
12
{
13
    public function __construct(
14
        private RouterInterface $router,
15
    ) {
16
    }
17
18
    public function __invoke(): void
19
    {
20
        $this->router->configure(static function (Routes $routes): void {
21
            $routes->get('/', HelloController::class);
22
        });
23
    }
24
}
25