Skip to content

Commit 3002756

Browse files
committed
Fix registry accessibility with SF v4.0.8
Reproduce bug Fix problem
1 parent 4f3de2b commit 3002756

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

.symfony_checker

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
use Knp\DictionaryBundle\Dictionary\DictionaryRegistry;
4+
use Knp\DictionaryBundle\KnpDictionaryBundle;
5+
use Pedrotroller\Symfony\IntegrationChecker\ConfigurableKernel;
6+
use Symfony\Component\DependencyInjection\ContainerBuilder;
7+
use Symfony\Component\HttpKernel\KernelInterface;
8+
use Webmozart\Assert\Assert;
9+
10+
$test = function (KernelInterface $kernel) {
11+
if (false === $kernel->getContainer()->get('knp_dictionary.registry') instanceof DictionaryRegistry) {
12+
throw new Exception('Service "knp_dictionary.registry" unavailable.');
13+
}
14+
};
15+
16+
return function (ConfigurableKernel $kernel) use ($test) {
17+
$container = new ContainerBuilder();
18+
19+
$kernel
20+
->setContainerBuilder($container)
21+
->addBundle(new KnpDictionaryBundle())
22+
->afterBoot($test)
23+
;
24+
};

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ before_script:
2323
script:
2424
- rm phpspec.yml
2525
- vendor/bin/phpspec -n -fpretty run
26+
- vendor/bin/symfony-integration-checker check

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"fzaninotto/faker": "~1.3",
3030
"leanphp/phpspec-code-coverage": "^4.0",
3131
"pedrotroller/php-cs-custom-fixer": "^2.6",
32+
"pedrotroller/symfony-integration-checker": "~2.0.0",
3233
"phpspec/phpspec": "~4.0",
3334
"phpspec/prophecy": ">=1.7.2",
3435
"sebastian/comparator": "~1.2.4",

src/Knp/DictionaryBundle/Resources/config/dictionary.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<tag name="knp_dictionary.factory"/>
2828
</service>
2929

30-
<service id="knp_dictionary.dictionary.dictionary_registry" class="Knp\DictionaryBundle\Dictionary\DictionaryRegistry"/>
30+
<service id="knp_dictionary.dictionary.dictionary_registry" class="Knp\DictionaryBundle\Dictionary\DictionaryRegistry" public="true"/>
3131

3232
<service id="knp_dictionary.dictionary.value_transformer.constant_transformer" class="Knp\DictionaryBundle\Dictionary\ValueTransformer\ConstantTransformer"/>
3333

@@ -56,6 +56,6 @@
5656
<argument type="service" id="knp_dictionary.registry"/>
5757
</service>
5858

59-
<service id="knp_dictionary.registry" alias="knp_dictionary.dictionary.dictionary_registry"/>
59+
<service id="knp_dictionary.registry" alias="knp_dictionary.dictionary.dictionary_registry" public="true"/>
6060
</services>
6161
</container>

0 commit comments

Comments
 (0)