Completed
Push — master ( 2b0bc5...73caa0 )
by Kévin
9s
created

AnnotationClassLoader::supports()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
eloc 2
nc 2
nop 2
1
<?php
2
3
/*
4
 * (c) Kévin Dunglas <[email protected]>
5
 *
6
 * This source file is subject to the MIT license that is bundled
7
 * with this source code in the file LICENSE.
8
 */
9
10
namespace Dunglas\ActionBundle\Routing;
11
12
use Symfony\Component\Routing\Loader\AnnotationClassLoader as BaseAnnotationClassLoader;
13
use Symfony\Component\Routing\Route;
14
15
/**
16
 * Sets the '_controller' default based on the service name associated with the action.
17
 *
18
 * @author Kévin Dunglas <[email protected]>
19
 */
20
class AnnotationClassLoader extends BaseAnnotationClassLoader
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
26
    {
27
        $route->setDefault('_controller', sprintf('controller.%s:%s', $class->name, $method->name));
28
    }
29
}
30