Completed
Push — master ( 9b25f2...d42705 )
by Tomáš
09:42 queued 07:08
created

SculpinCompilerExtension::beforeCompile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Symplify
7
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
8
 */
9
10
namespace Symplify\PHP7_Sculpin\DI;
11
12
use Nette\DI\Compiler;
13
use Nette\DI\CompilerExtension;
14
use Symfony\Component\Console\Command\Command;
15
use Symplify\PHP7_Sculpin\Console\Application;
16
use Symplify\PHP7_Sculpin\Contract\Source\SourceFileFilter\SourceFileFilterInterface;
17
use Symplify\PHP7_Sculpin\DI\Helper\TypeAndCollectorTrait;
18
use Symplify\PHP7_Sculpin\Source\SourceFileStorage;
19
20
final class SculpinCompilerExtension extends CompilerExtension
21
{
22
    use TypeAndCollectorTrait;
23
24 3
    public function loadConfiguration()
25
    {
26 3
        Compiler::loadDefinitions(
27 3
            $this->getContainerBuilder(),
28 3
            $this->loadFromFile(__DIR__.'/../config/services.neon')['services']
29
        );
30 3
    }
31
32 2
    public function beforeCompile()
33
    {
34 2
        $this->collectByType(Application::class, Command::class, 'add');
35 2
        $this->collectByType(SourceFileStorage::class, SourceFileFilterInterface::class, 'addSourceFileFilter');
36 2
    }
37
}
38