Completed
Pull Request — 8.x-1.x (#7)
by
unknown
65:17
created

RouteOptionsBase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A modifyRoute() 0 4 1
1
<?php
2
3
namespace Drupal\controller_annotations\RouteModifier;
4
5
use Symfony\Component\Routing\Route;
6
7
abstract class RouteOptionsBase implements RouteModifierInterface
8
{
9
10
    /**
11
     * @var array
12
     */
13
    private $options;
14
15
    /**
16
     * @param array $options
17
     */
18
    protected function __construct(array $options)
19
    {
20
        $this->options = $options;
21
    }
22
23
    /**
24
     * @param \Symfony\Component\Routing\Route $route
25
     */
26
    public function modifyRoute(Route $route)
27
    {
28
        $route->addOptions($this->options);
29
    }
30
}
31