File tree Expand file tree Collapse file tree 5 files changed +24
-10
lines changed
DependencyInjection/CompilerPass Expand file tree Collapse file tree 5 files changed +24
-10
lines changed Original file line number Diff line number Diff line change 6363 run : vendor/bin/phpunit
6464
6565 - 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 99 "text": "infection-log.txt"
1010 },
1111 "mutators": {
12- "@default": true
12+ "@default": true,
13+
14+ "UnwrapUcWords": {
15+ "ignore": [
16+ "Budgegeria\\Bundle\\IntlBundle\\DependencyInjection\\CompilerPass\\SorterConfigPass::toCamelCase"
17+ ]
18+ }
1319 }
14- }
20+ }
Original file line number Diff line number Diff line change @@ -13,7 +13,5 @@ class BudgegeriaIntlBundle extends Bundle
1313 public function build (ContainerBuilder $ container ): void
1414 {
1515 $ container ->addCompilerPass (new SorterConfigPass ());
16-
17- parent ::build ($ container );
1816 }
1917}
Original file line number Diff line number Diff line change 1010use Symfony \Component \DependencyInjection \ContainerBuilder ;
1111use Symfony \Component \DependencyInjection \Definition ;
1212use Symfony \Component \DependencyInjection \Reference ;
13+ use function array_keys ;
14+ use function str_replace ;
15+ use function ucwords ;
1316
1417class SorterConfigPass implements CompilerPassInterface
1518{
@@ -30,11 +33,8 @@ public function process(ContainerBuilder $container): void
3033
3134 $ definition = new Definition (Builder::class, [$ locale ]);
3235
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 ));
3838 }
3939
4040 $ container ->setDefinition (self ::SERVICE_FACTORY_PREFIX .$ serviceSuffix , $ definition );
Original file line number Diff line number Diff line change 55namespace Budgegeria \Bundle \IntlBundle \Tests \Integration ;
66
77use PHPUnit \Framework \TestCase ;
8+ use Symfony \Component \DependencyInjection \Exception \ParameterNotFoundException ;
89
910class SorterTest extends TestCase
1011{
@@ -60,4 +61,13 @@ public function configuredSorterBuilderServiceWithoutLocale(): void
6061
6162 self ::assertSame ($ expected , $ sorted );
6263 }
64+
65+ /**
66+ * @test
67+ */
68+ public function internalSorterConfigIsRemovedAfterContainerIsCompiled (): void
69+ {
70+ $ this ->expectException (ParameterNotFoundException::class);
71+ $ this ->createContainer ()->getParameter ('budgegeria_intl.sorter ' );
72+ }
6373}
You can’t perform that action at this time.
0 commit comments