Test Setup Failed
Push — master ( 1a9491...b3bb4f )
by Pascal
09:30
created

AnnotationClassLoader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configureRoute() 0 4 1
1
<?php
2
3
namespace Skalpa\Silex\Symfony\Loader;
4
5
use Symfony\Component\Routing\Loader\AnnotationClassLoader as BaseAnnotationClassLoader;
6
use Symfony\Component\Routing\Route;
7
8
/**
9
 * Annotation loader that uses an external callable to configure routes.
10
 */
11
class AnnotationClassLoader extends BaseAnnotationClassLoader
12
{
13
    private $configurationStrategy;
14
15
    public function __construct(Reader $reader, callable $configurationStrategy)
16
    {
17
        parent::__construct($reader);
18
19
        $this->configurationStrategy = $configurationStrategy;
20
    }
21
22
    protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
23
    {
24
        $this->configurationStrategy($route, $class, $method, $annot);
0 ignored issues
show
Bug introduced by
The method configurationStrategy() does not seem to exist on object<Skalpa\Silex\Symf...\AnnotationClassLoader>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
25
    }
26
}
27