Skip to content

Commit

Permalink
SUPPORT-86536 - fixed symfony 6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri Gaidoba committed Dec 4, 2023
1 parent 60c83b6 commit 5f02b29
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
7 changes: 7 additions & 0 deletions src/DependencyInjection/PayseraApiExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ public function load(array $configs, ContainerBuilder $container)
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.xml');

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config/services'));
if (class_exists(\Symfony\Bundle\FrameworkBundle\Routing\AttributeRouteControllerLoader::class)) {
$loader->load('annotations.xml');
} else {
$loader->load('annotations_legacy.xml');
}

$container->setParameter('paysera_api.locales', $config['locales']);
if (count($config['locales']) === 0) {
$container->removeDefinition('paysera_api.listener.locale');
Expand Down
1 change: 0 additions & 1 deletion src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<imports>
<import resource="services/annotations.xml"/>
<import resource="services/listeners.xml"/>
<import resource="services/normalizers.xml"/>
<import resource="services/pagination.xml"/>
Expand Down
12 changes: 0 additions & 12 deletions src/Resources/config/services/annotations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>

<service decorates="routing.loader.annotation"
parent="routing.loader.annotation"
id="paysera_api.annotations.loader"
class="Paysera\Bundle\ApiBundle\Service\Annotation\RoutingAnnotationLoader">
<call method="setRequestHelper">
<argument type="service" id="paysera_api.rest_request_helper"/>
</call>
<call method="setRestRequestOptionsBuilder">
<argument type="service" id="paysera_api.annotations.options_builder"/>
</call>
</service>

<service decorates="routing.loader.attribute"
parent="routing.loader.attribute"
id="paysera_api.loader.attribute"
Expand Down
25 changes: 25 additions & 0 deletions src/Resources/config/services/annotations_legacy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>

<service decorates="routing.loader.annotation"
parent="routing.loader.annotation"
id="paysera_api.annotations.loader"
class="Paysera\Bundle\ApiBundle\Service\Annotation\RoutingAnnotationLoader">
<call method="setRequestHelper">
<argument type="service" id="paysera_api.rest_request_helper"/>
</call>
<call method="setRestRequestOptionsBuilder">
<argument type="service" id="paysera_api.annotations.options_builder"/>
</call>
</service>

<service id="paysera_api.annotations.options_builder"
class="Paysera\Bundle\ApiBundle\Service\Annotation\RestRequestOptionsBuilder">
<argument type="service" id="paysera_api.rest_request_options_validator"/>
</service>
</services>
</container>

0 comments on commit 5f02b29

Please sign in to comment.