CrudsRouteFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 19
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 16 1
1
<?php
2
3
namespace ScayTrase\Api\Cruds\Routing;
4
5
use Symfony\Component\Routing\Route;
6
7
final class CrudsRouteFactory
8
{
9 2
    public static function create($path, $controller, array $methods, array $options = []): Route
10
    {
11 2
        return new Route(
12 2
            $path,
13
            [
14 2
                '_controller' => $controller,
15 2
                '_cruds_api'  => array_replace(['enabled' => true], $options),
16
            ],
17 2
            [],
18 2
            [],
19 2
            '',
20 2
            [],
21 2
            $methods,
22 2
            ''
23
        );
24
    }
25
}
26