-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix registry accessibility with SF v4.0.8
Reproduce bug Fix problem
- Loading branch information
1 parent
4f3de2b
commit 3002756
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters