Completed
Push — 8.x-1.x ( 5411ec...980b0f )
by
unknown
33:53 queued 31:38
created

Method::modifyRoute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Drupal\controller_annotations\Configuration;
4
5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method as BaseMethod;
6
use Symfony\Component\Routing\Route as RoutingRoute;
7
8
/**
9
 * @Annotation
10
 */
11
class Method extends BaseMethod implements RouteModifierInterface
12
{
13
    /**
14
     * we need to make sure this is an array instead of a string which is different in Symfony Framework
15
     * otherwise the support for defining an array of methods will not work as expected
16
     *
17
     * @param RoutingRoute $route
18
     */
19 6
    public function modifyRoute(RoutingRoute $route)
20
    {
21 6
        $route->setMethods($this->getMethods());
22 6
    }
23
}
24