Passed
Push — master ( 5383f1...af8f48 )
by Gabriel
03:29
created

DelegatingLoader::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.037

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 2
cts 3
cp 0.6667
crap 1.037
rs 10
1
<?php
2
3
namespace Nip\Router\Loader;
4
5
use Symfony\Component\Config\Loader\DelegatingLoader as SymfonyDirectoryLoader;
6
use Symfony\Component\Routing\RouteCollection;
7
8
/**
9
 * Class DelegatingLoader
10
 * @package Nip\Router\Loader
11
 */
12
class DelegatingLoader extends SymfonyDirectoryLoader
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 2
    public function load($file, $type = null)
18
    {
19 2
        $collection = parent::load($file, $type);
20
        return $this->transformCollection($collection);
21
    }
22
23
    /**
24
     * @param RouteCollection $symfonyCollection
25
     * @return \Nip\Router\RouteCollection
26
     */
27
    protected function transformCollection(RouteCollection $symfonyCollection)
28
    {
29
        $collection = new \Nip\Router\RouteCollection();
30
        $collection->addCollection($symfonyCollection);
31
32
        return $collection;
33
    }
34
}
35