1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the doyo/code-coverage 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\CodeCoverage; |
||
15 | |||
16 | use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface; |
||
17 | use Behat\Testwork\ServiceContainer\ExtensionManager; |
||
18 | use Doyo\Behat\CodeCoverage\Controller\CliController; |
||
19 | use Doyo\Behat\CodeCoverage\Listener\CoverageListener; |
||
20 | use Doyo\Bridge\CodeCoverage\Configuration; |
||
0 ignored issues
–
show
|
|||
21 | use Doyo\Bridge\CodeCoverage\ContainerFactory; |
||
0 ignored issues
–
show
The type
Doyo\Bridge\CodeCoverage\ContainerFactory was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
22 | use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; |
||
23 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
24 | use Symfony\Component\DependencyInjection\Definition; |
||
25 | use Symfony\Component\DependencyInjection\Reference; |
||
26 | |||
27 | class Extension implements ExtensionInterface |
||
28 | { |
||
29 | public function process(ContainerBuilder $container) |
||
30 | { |
||
31 | } |
||
32 | |||
33 | public function getConfigKey() |
||
34 | { |
||
35 | return 'doyo_coverage'; |
||
36 | } |
||
37 | |||
38 | public function initialize(ExtensionManager $extensionManager) |
||
39 | { |
||
40 | // TODO: Implement initialize() method. |
||
41 | } |
||
42 | |||
43 | public function configure(ArrayNodeDefinition $builder) |
||
44 | { |
||
45 | $configuration = new Configuration(); |
||
46 | $configuration->configure($builder); |
||
47 | |||
48 | return $builder; |
||
49 | } |
||
50 | |||
51 | public function load(ContainerBuilder $container, array $config) |
||
52 | { |
||
53 | $definition = new Definition(CliController::class); |
||
54 | $definition->setPublic(true); |
||
55 | $definition->addTag('cli.controller', ['priority' => 80000]); |
||
56 | $container->setDefinition('doyo.coverage.cli_controller', $definition); |
||
57 | |||
58 | // load listener |
||
59 | $coverageContainer = (new ContainerFactory($config, true))->getContainer(); |
||
60 | $coverageContainer->set('console.input', $container->get('cli.input')); |
||
61 | $coverageContainer->set('console.output', $container->get('cli.output')); |
||
62 | |||
63 | $container->set('doyo.coverage.container', $coverageContainer); |
||
64 | $container->set('doyo.coverage', $coverageContainer->get('coverage')); |
||
65 | |||
66 | $input = $container->get('cli.input'); |
||
67 | $coverageEnabled = $input->hasParameterOption(['--coverage'], true); |
||
68 | $container->setParameter('doyo.coverage_enabled', $coverageEnabled); |
||
69 | |||
70 | $listener = new Definition(CoverageListener::class); |
||
71 | $listener->addArgument(new Reference('doyo.coverage')); |
||
72 | $listener->addArgument($container->getParameterBag()->get('doyo.coverage_enabled')); |
||
73 | $listener->addTag('event_dispatcher.subscriber'); |
||
74 | |||
75 | $container->setDefinition('doyo.coverage.listener', $listener); |
||
76 | } |
||
77 | } |
||
78 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths