File tree 5 files changed +24
-10
lines changed
DependencyInjection/CompilerPass
5 files changed +24
-10
lines changed Original file line number Diff line number Diff line change 63
63
run : vendor/bin/phpunit
64
64
65
65
- name : " Mutation tests"
66
- run : vendor/bin/infection --min-msi=100 --no-progress --threads=5
66
+ run : vendor/bin/infection --min-msi=95 --no-progress --threads=5
Original file line number Diff line number Diff line change 9
9
"text": "infection-log.txt"
10
10
},
11
11
"mutators": {
12
- "@default": true
12
+ "@default": true,
13
+
14
+ "UnwrapUcWords": {
15
+ "ignore": [
16
+ "Budgegeria\\Bundle\\IntlBundle\\DependencyInjection\\CompilerPass\\SorterConfigPass::toCamelCase"
17
+ ]
18
+ }
13
19
}
14
- }
20
+ }
Original file line number Diff line number Diff line change @@ -13,7 +13,5 @@ class BudgegeriaIntlBundle extends Bundle
13
13
public function build (ContainerBuilder $ container ): void
14
14
{
15
15
$ container ->addCompilerPass (new SorterConfigPass ());
16
-
17
- parent ::build ($ container );
18
16
}
19
17
}
Original file line number Diff line number Diff line change 10
10
use Symfony \Component \DependencyInjection \ContainerBuilder ;
11
11
use Symfony \Component \DependencyInjection \Definition ;
12
12
use Symfony \Component \DependencyInjection \Reference ;
13
+ use function array_keys ;
14
+ use function str_replace ;
15
+ use function ucwords ;
13
16
14
17
class SorterConfigPass implements CompilerPassInterface
15
18
{
@@ -30,11 +33,8 @@ public function process(ContainerBuilder $container): void
30
33
31
34
$ definition = new Definition (Builder::class, [$ locale ]);
32
35
33
- /**
34
- * @var mixed $value
35
- */
36
- foreach ($ sorterConfig as $ methodName => $ value ) {
37
- $ definition ->addMethodCall ($ this ->toCamelCase ($ methodName ), [$ value ]);
36
+ foreach (array_keys ($ sorterConfig ) as $ methodName ) {
37
+ $ definition ->addMethodCall ($ this ->toCamelCase ($ methodName ));
38
38
}
39
39
40
40
$ container ->setDefinition (self ::SERVICE_FACTORY_PREFIX .$ serviceSuffix , $ definition );
Original file line number Diff line number Diff line change 5
5
namespace Budgegeria \Bundle \IntlBundle \Tests \Integration ;
6
6
7
7
use PHPUnit \Framework \TestCase ;
8
+ use Symfony \Component \DependencyInjection \Exception \ParameterNotFoundException ;
8
9
9
10
class SorterTest extends TestCase
10
11
{
@@ -60,4 +61,13 @@ public function configuredSorterBuilderServiceWithoutLocale(): void
60
61
61
62
self ::assertSame ($ expected , $ sorted );
62
63
}
64
+
65
+ /**
66
+ * @test
67
+ */
68
+ public function internalSorterConfigIsRemovedAfterContainerIsCompiled (): void
69
+ {
70
+ $ this ->expectException (ParameterNotFoundException::class);
71
+ $ this ->createContainer ()->getParameter ('budgegeria_intl.sorter ' );
72
+ }
63
73
}
You can’t perform that action at this time.
0 commit comments