• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

valksor / php-bundle / 21323304205

24 Jan 2026 11:21PM UTC coverage: 61.471% (-3.6%) from 65.046%
21323304205

push

github

k0d3r1s
wip

3 of 3 new or added lines in 1 file covered. (100.0%)

113 existing lines in 4 files now uncovered.

493 of 802 relevant lines covered (61.47%)

1.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.68
/DependencyInjection/AbstractDependencyConfiguration.php
1
<?php declare(strict_types = 1);
2

3
/*
4
 * This file is part of the Valksor package.
5
 *
6
 * (c) Davis Zalitis (k0d3r1s)
7
 * (c) SIA Valksor <packages@valksor.com>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12

13
namespace Valksor\Bundle\DependencyInjection;
14

15
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
18
use Valksor\Bundle\ValksorBundle;
19
use Valksor\Functions\Php;
20

21
use function array_merge_recursive;
22
use function dirname;
23
use function is_file;
24
use function sprintf;
25

26
abstract class AbstractDependencyConfiguration implements Dependency
27
{
28
    public function addSection(
29
        ArrayNodeDefinition $rootNode,
30
        callable $enableIfStandalone,
31
        string $component,
32
    ): void {
33
        $rootNode
1✔
34
            ->children()
1✔
35
                ->arrayNode($component)
1✔
36
                    ->{$enableIfStandalone(sprintf('%s/%s', ValksorBundle::VALKSOR, $component), self::class)}()
1✔
37
                ->end();
1✔
38
    }
39

40
    public function autoDiscover(): bool
41
    {
42
        return true;
×
43
    }
44

45
    public function build(
46
        ContainerBuilder $container,
47
    ): void {
48
    }
1✔
49

50
    public function registerConfiguration(
51
        ContainerConfigurator $container,
52
        ContainerBuilder $builder,
53
        string $component,
54
    ): void {
55
        static $_helper = null;
2✔
56

57
        if (null === $_helper) {
2✔
58
            $_helper = new class {
1✔
59
                use Php\Traits\_GetReflection;
60
            };
1✔
61
        }
62

63
        $path = dirname($_helper->getReflection(static::class)->getFileName(), 2) . '/Resources/config/services.php';
2✔
64

65
        if (is_file($path)) {
2✔
66
            $container->import($path);
2✔
67
        }
68
    }
69

70
    public function registerPreConfiguration(
71
        ContainerConfigurator $container,
72
        ContainerBuilder $builder,
73
        string $component,
74
    ): void {
75
    }
2✔
76

77
    public function usesArrayPrototype(): bool
78
    {
79
        return false;
×
80
    }
81

82
    public function usesDoctrine(): bool
83
    {
UNCOV
84
        return false;
×
85
    }
86

87
    /**
88
     * Get default configuration values for this component.
89
     *
90
     * Override this method in child classes to provide default values.
91
     * The returned array structure should match the configuration tree
92
     * defined in addSection().
93
     *
94
     * @return array<string, mixed> Default configuration values
95
     */
96
    public static function getDefaults(): array
97
    {
UNCOV
98
        return [];
×
99
    }
100

101
    /**
102
     * @return array<string, mixed>
103
     */
104
    protected function mergeConfig(
105
        ContainerBuilder $builder,
106
        string $extension,
107
    ): array {
UNCOV
108
        return array_merge_recursive(...$builder->getExtensionConfig($extension));
×
109
    }
110
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc