CushonHealthBundle::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cushon\HealthBundle;
6
7
use Cushon\HealthBundle\DependencyInjection\Compiler\DebuggerPass;
0 ignored issues
show
Bug introduced by
The type Cushon\HealthBundle\Depe...n\Compiler\DebuggerPass 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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Cushon\HealthBundle\DependencyInjection\CushonHealthExtension;
9
use Cushon\HealthBundle\Traits\BundleRootKeyTrait;
10
use Symfony\Component\Config\FileLocator;
11
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
12
use Symfony\Component\DependencyInjection\ContainerBuilder;
13
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
14
use Symfony\Component\HttpKernel\Bundle\Bundle;
15
16
/**
17
 * @psalm-suppress PropertyNotSetInConstructor Bundle uses Symfony's ContainerAwareTrait
18
 */
19
final class CushonHealthBundle extends Bundle
20
{
21
    use BundleRootKeyTrait;
22
23
    public const BUNDLE_PATH = __DIR__;
24
    public const CONFIG_PATH = self::BUNDLE_PATH . '/Resources/config';
25
26
    public const BUNDLE_ROOT_KEY = 'cushon_health';
27
28
    public const BUNDLE_PATH_KEY = 'bundle_path';
29
30
    /**
31
     * @param string $rootKey
32
     */
33
    public function __construct(string $rootKey = self::BUNDLE_ROOT_KEY)
34
    {
35
        $this->rootKey = $rootKey;
36
    }
37
38
    /**
39
     * @inheritDoc
40
     */
41
    public function build(ContainerBuilder $container): void
42
    {
43
        $container->setParameter($this->generateKeyFromRoot(self::BUNDLE_PATH_KEY), self::BUNDLE_PATH);
44
    }
45
46
    /**
47
     * @inheritDoc
48
     */
49
    public function getContainerExtension(): ?ExtensionInterface
50
    {
51
        return new CushonHealthExtension(
52
            new FileLocator(self::CONFIG_PATH),
53
            $this->rootKey
54
        );
55
    }
56
}
57