• 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

81.25
/DependencyInjection/ValksorConfiguration.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

19
final class ValksorConfiguration extends AbstractDependencyConfiguration
20
{
21
    public function addSection(
22
        ArrayNodeDefinition $rootNode,
23
        callable $enableIfStandalone,
24
        string $component,
25
    ): void {
26
        $rootNode
1✔
27
            ->children()
1✔
28
                ->arrayNode('project')
1✔
29
                ->info('Project directory structure configuration')
1✔
30
                ->addDefaultsIfNotSet()
1✔
31
                ->children()
1✔
32
                    ->scalarNode('apps_dir')
1✔
33
                        ->info('Directory containing applications (relative to project root)')
1✔
34
                        ->defaultNull()
1✔
35
                        ->example('apps')
1✔
36
                    ->end()
1✔
37
                    ->scalarNode('infrastructure_dir')
1✔
38
                        ->info('Directory containing shared resources (relative to project root)')
1✔
39
                        ->defaultNull()
1✔
40
                        ->example('infrastructure')
1✔
41
                    ->end()
1✔
42
                    ->arrayNode('autoload')
1✔
43
                        ->info('Autoload configuration')
1✔
44
                        ->addDefaultsIfNotSet()
1✔
45
                        ->children()
1✔
46
                            ->scalarNode('namespace_prefix')
1✔
47
                                ->info('Namespace prefix for generated autoload classes')
1✔
48
                                ->defaultNull()
1✔
49
                            ->end()
1✔
50
                        ->end()
1✔
51
                    ->end()
1✔
52
                ->end()
1✔
53
            ->end();
1✔
54
    }
55

56
    public function registerGlobalMigrations(
57
        ContainerConfigurator $container,
58
        ContainerBuilder $builder,
59
    ): void {
60
        if ($builder->hasExtension('doctrine')) {
1✔
61
            if ($builder->hasExtension('doctrine_migrations')) {
1✔
62
                $container->extension('doctrine_migrations', [
1✔
63
                    'migrations_paths' => [
1✔
64
                        'Valksor\\Bundle\\Migrations' => __DIR__ . '/../Resources/migrations',
1✔
65
                    ],
1✔
66
                ]);
1✔
67
            }
68
        }
69
    }
70

71
    public function registerPreConfiguration(
72
        ContainerConfigurator $container,
73
        ContainerBuilder $builder,
74
        string $component,
75
    ): void {
76
        if ($builder->hasExtension('framework')) {
2✔
77
            $container->extension('framework', [
2✔
78
                'set_locale_from_accept_language' => true,
2✔
79
            ]);
2✔
80
        }
81
    }
82

83
    public static function getDefaults(): array
84
    {
UNCOV
85
        return [
×
UNCOV
86
            'project' => [
×
UNCOV
87
                'apps_dir' => 'apps',
×
UNCOV
88
                'infrastructure_dir' => 'infrastructure',
×
UNCOV
89
                'autoload' => [
×
UNCOV
90
                    'namespace_prefix' => 'Application',
×
UNCOV
91
                ],
×
UNCOV
92
            ],
×
UNCOV
93
        ];
×
94
    }
95
}
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