1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the DoyoUserBundle project. |
||
5 | * |
||
6 | * (c) Anthonius Munthi <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | declare(strict_types=1); |
||
13 | |||
14 | namespace Doyo\Behat\Coverage; |
||
15 | |||
16 | use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface; |
||
17 | use Behat\Testwork\ServiceContainer\ExtensionManager; |
||
18 | use Doyo\Behat\Coverage\Compiler\DriverPass; |
||
19 | use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; |
||
20 | use Symfony\Component\Config\FileLocator; |
||
21 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
22 | use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; |
||
23 | |||
24 | class Extension implements ExtensionInterface |
||
25 | { |
||
26 | public function process(ContainerBuilder $container) |
||
27 | { |
||
28 | } |
||
29 | |||
30 | 1 | public function getConfigKey() |
|
31 | { |
||
32 | 1 | return 'doyo'; |
|
33 | } |
||
34 | |||
35 | public function initialize(ExtensionManager $extensionManager) |
||
36 | { |
||
37 | } |
||
38 | |||
39 | 1 | public function configure(ArrayNodeDefinition $builder) |
|
40 | { |
||
41 | 1 | $config = new Configuration(); |
|
42 | 1 | $config->configure($builder); |
|
43 | |||
44 | 1 | return $builder; |
|
45 | } |
||
46 | |||
47 | 1 | public function load(ContainerBuilder $container, array $config) |
|
48 | { |
||
49 | 1 | $this->loadServices($container, $config); |
|
50 | |||
51 | 1 | $container->setParameter('doyo.coverage.options', $config['coverage']); |
|
52 | } |
||
53 | |||
54 | 1 | private function loadServices(ContainerBuilder $container, array $config) |
|
0 ignored issues
–
show
|
|||
55 | { |
||
56 | 1 | $locator = new FileLocator(__DIR__.'/Resources/config'); |
|
57 | 1 | $loader = new XmlFileLoader($container, $locator); |
|
58 | |||
59 | 1 | $loader->load('core.xml'); |
|
60 | 1 | $loader->load('drivers.xml'); |
|
61 | 1 | $loader->load('coverage.xml'); |
|
62 | |||
63 | 1 | $container->addCompilerPass(new DriverPass()); |
|
64 | } |
||
65 | } |
||
66 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.