Completed
Pull Request — master (#17)
by Pavel
10:35
created

CrudsRouteFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
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 21
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

1 Method

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