Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3.009 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | 1 | public function load($resource, $type = null) |
|
36 | { |
||
37 | 1 | if (!is_dir($resource)) { |
|
38 | throw new \InvalidArgumentException(sprintf('Given resource of type "%s" is no directory.', $resource)); |
||
39 | } |
||
40 | |||
41 | 1 | $collection = new RouteCollection(); |
|
42 | |||
43 | 1 | $finder = new Finder(); |
|
44 | |||
45 | 1 | foreach ($finder->in($resource)->name('*.php')->files() as $file) { |
|
46 | 1 | $imported = $this->processor->importResource($this, ClassUtils::findClassInFile($file), array(), null, null, 'rest'); |
|
47 | 1 | $collection->addCollection($imported); |
|
48 | 1 | } |
|
49 | |||
50 | 1 | return $collection; |
|
51 | } |
||
52 | |||
61 |