Skip to content

Commit

Permalink
Declare runtime as service (#514)
Browse files Browse the repository at this point in the history
* Declare runtime as service

* Remove private
  • Loading branch information
VincentLanglet authored Apr 11, 2022
1 parent 48d0fc2 commit aa7bb1d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Resources/config/intl.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
use Sonata\IntlBundle\Timezone\ChainTimezoneDetector;
use Sonata\IntlBundle\Timezone\LocaleBasedTimezoneDetector;
use Sonata\IntlBundle\Timezone\UserBasedTimezoneDetector;
use Sonata\IntlBundle\Twig\DateTimeRuntime;
use Sonata\IntlBundle\Twig\Extension\DateTimeExtension;
use Sonata\IntlBundle\Twig\Extension\LocaleExtension;
use Sonata\IntlBundle\Twig\Extension\NumberExtension;
use Sonata\IntlBundle\Twig\LocaleRuntime;
use Sonata\IntlBundle\Twig\NumberRuntime;
use Sonata\IntlBundle\Util\BCDeprecationParameters;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;
Expand Down Expand Up @@ -115,6 +118,24 @@
new ReferenceConfigurator('sonata.intl.templating.helper.datetime'),
])

->set('sonata.intl.twig.runtime.locale', LocaleRuntime::class)
->tag('twig.runtime')
->args([
new ReferenceConfigurator('sonata.intl.templating.helper.locale'),
])

->set('sonata.intl.twig.runtime.number', NumberRuntime::class)
->tag('twig.runtime')
->args([
new ReferenceConfigurator('sonata.intl.templating.helper.number'),
])

->set('sonata.intl.twig.runtime.datetime', DateTimeRuntime::class)
->tag('twig.runtime')
->args([
new ReferenceConfigurator('sonata.intl.templating.helper.datetime'),
])

->set('sonata.intl.timezone_detector.chain', '%sonata.intl.timezone_detector.chain.class%')
->public()
->args([
Expand Down

0 comments on commit aa7bb1d

Please sign in to comment.