Skip to content

Commit

Permalink
Fix registry accessibility with SF v4.0.8
Browse files Browse the repository at this point in the history
Reproduce bug

Fix problem
  • Loading branch information
PedroTroller committed Apr 30, 2018
1 parent 4f3de2b commit 3002756
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .symfony_checker
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

use Knp\DictionaryBundle\Dictionary\DictionaryRegistry;
use Knp\DictionaryBundle\KnpDictionaryBundle;
use Pedrotroller\Symfony\IntegrationChecker\ConfigurableKernel;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\KernelInterface;
use Webmozart\Assert\Assert;

$test = function (KernelInterface $kernel) {
if (false === $kernel->getContainer()->get('knp_dictionary.registry') instanceof DictionaryRegistry) {
throw new Exception('Service "knp_dictionary.registry" unavailable.');
}
};

return function (ConfigurableKernel $kernel) use ($test) {
$container = new ContainerBuilder();

$kernel
->setContainerBuilder($container)
->addBundle(new KnpDictionaryBundle())
->afterBoot($test)
;
};
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ before_script:
script:
- rm phpspec.yml
- vendor/bin/phpspec -n -fpretty run
- vendor/bin/symfony-integration-checker check
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"fzaninotto/faker": "~1.3",
"leanphp/phpspec-code-coverage": "^4.0",
"pedrotroller/php-cs-custom-fixer": "^2.6",
"pedrotroller/symfony-integration-checker": "~2.0.0",
"phpspec/phpspec": "~4.0",
"phpspec/prophecy": ">=1.7.2",
"sebastian/comparator": "~1.2.4",
Expand Down
4 changes: 2 additions & 2 deletions src/Knp/DictionaryBundle/Resources/config/dictionary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<tag name="knp_dictionary.factory"/>
</service>

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

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

Expand Down Expand Up @@ -56,6 +56,6 @@
<argument type="service" id="knp_dictionary.registry"/>
</service>

<service id="knp_dictionary.registry" alias="knp_dictionary.dictionary.dictionary_registry"/>
<service id="knp_dictionary.registry" alias="knp_dictionary.dictionary.dictionary_registry" public="true"/>
</services>
</container>

0 comments on commit 3002756

Please sign in to comment.