Skip to content

Commit

Permalink
[DX] Make services private (#17276)
Browse files Browse the repository at this point in the history
| Q               | A
|-----------------|-----
| Branch?         | 2.0
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | n/a
| License         | MIT

<!--
 - Bug fixes must be submitted against the 1.13 branch
 - Features and deprecations must be submitted against the 1.14 branch
- Features, removing deprecations and BC breaks must be submitted
against the 2.0 branch
 - Make sure that the correct base branch is set

To be sure you are not breaking any Backward Compatibilities, check the
documentation:

https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->
  • Loading branch information
GSadee authored Oct 23, 2024
2 parents 0e758b6 + a403735 commit 82c2a57
Show file tree
Hide file tree
Showing 113 changed files with 109 additions and 323 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
</imports>

<services>
<defaults public="true" />

<service id="sylius.custom_factory.zone" class="Sylius\Component\Addressing\Factory\ZoneFactory" decorates="sylius.factory.zone" decoration-priority="256" public="false">
<service id="sylius.custom_factory.zone" class="Sylius\Component\Addressing\Factory\ZoneFactory" decorates="sylius.factory.zone" decoration-priority="256">
<argument type="service" id="sylius.custom_factory.zone.inner" />
<argument type="service" id="sylius.factory.zone_member" />
</service>
Expand All @@ -36,10 +34,10 @@
</service>
<service id="Sylius\Component\Addressing\Provider\ProvinceNamingProviderInterface" alias="sylius.provider.province_naming" />

<service id="sylius.matcher.zone" class="Sylius\Component\Addressing\Matcher\ZoneMatcher">
<service id="sylius.matcher.zone" class="Sylius\Component\Addressing\Matcher\ZoneMatcher" public="true">
<argument type="service" id="sylius.repository.zone" />
</service>
<service id="Sylius\Component\Addressing\Matcher\ZoneMatcherInterface" alias="sylius.matcher.zone" />
<service id="Sylius\Component\Addressing\Matcher\ZoneMatcherInterface" alias="sylius.matcher.zone" public="true" />

<service id="sylius.converter.country_name" class="Sylius\Component\Addressing\Converter\CountryNameConverter" />
<service id="Sylius\Component\Addressing\Converter\CountryNameConverterInterface" alias="sylius.converter.country_name" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />

<service id="sylius.checker.zone_deletion" class="Sylius\Component\Addressing\Checker\ZoneDeletionChecker">
<argument type="service" id="sylius.repository.zone_member" />
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
</parameters>

<services>
<defaults public="true" />

<service id="sylius.form.type.address" class="Sylius\Bundle\AddressingBundle\Form\Type\AddressType">
<argument>%sylius.model.address.class%</argument>
<argument>%sylius.form.type.address.validation_groups%</argument>
Expand Down
8 changes: 3 additions & 5 deletions src/Sylius/Bundle/AdminBundle/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@
</parameters>

<services>
<defaults public="true" />

<service id="sylius_admin.console.command.create_admin_user" class="Sylius\Bundle\AdminBundle\Console\Command\CreateAdminUserCommand">
<service id="sylius_admin.console.command.create_admin_user" class="Sylius\Bundle\AdminBundle\Console\Command\CreateAdminUserCommand" public="true">
<argument type="service" id="sylius.command_bus" />
<argument>%sylius_locale.locale%</argument>
<argument type="service" id="sylius_admin.console.command_factory.question" />
<tag name="console.command" />
</service>

<service id="sylius_admin.console.command.change_admin_user_password" class="Sylius\Bundle\AdminBundle\Console\Command\ChangeAdminUserPasswordCommand">
<service id="sylius_admin.console.command.change_admin_user_password" class="Sylius\Bundle\AdminBundle\Console\Command\ChangeAdminUserPasswordCommand" public="true">
<argument type="service" id="sylius.repository.admin_user" />
<argument type="service" id="sylius.security.password_updater" />
<argument type="service" id="sylius_admin.console.command_factory.question" />
Expand Down Expand Up @@ -66,7 +64,7 @@
<tag name="sylius.uri_based_section_resolver" priority="20" />
</service>

<service id="sylius.http_client" alias="Psr\Http\Client\ClientInterface" public="false" />
<service id="sylius.http_client" alias="Psr\Http\Client\ClientInterface" />

<service id="sylius.attribute_type.select" class="Sylius\Component\Attribute\AttributeType\SelectAttributeType">
<tag name="sylius.attribute.type" attribute-type="select" label="Select"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@
<argument type="service" id="twig" />
</service>

<service id="sylius_admin.controller.remove_avatar" class="Sylius\Bundle\AdminBundle\Action\RemoveAvatarAction" public="true">
<service id="sylius_admin.controller.remove_avatar" class="Sylius\Bundle\AdminBundle\Action\RemoveAvatarAction">
<argument type='service' id="sylius.repository.avatar_image" />
<argument type="service" id="router" />
<argument type="service" id="security.csrf.token_manager" />
</service>

<service id="sylius_admin.controller.resend_order_confirmation_email" class="Sylius\Bundle\AdminBundle\Action\ResendOrderConfirmationEmailAction" public="true">
<service id="sylius_admin.controller.resend_order_confirmation_email" class="Sylius\Bundle\AdminBundle\Action\ResendOrderConfirmationEmailAction">
<argument type='service' id="sylius.repository.order" />
<argument type="service" id="sylius.command_dispatcher.resend_order_confirmation_email" />
<argument type="service" id="security.csrf.token_manager" />
<argument type="service" id="request_stack" />
<argument type="service" id="router" />
</service>

<service id="sylius_admin.controller.resend_shipment_confirmation_email" class="Sylius\Bundle\AdminBundle\Action\ResendShipmentConfirmationEmailAction" public="true">
<service id="sylius_admin.controller.resend_shipment_confirmation_email" class="Sylius\Bundle\AdminBundle\Action\ResendShipmentConfirmationEmailAction">
<argument type='service' id="sylius.repository.shipment" />
<argument type="service" id="sylius.command_dispatcher.resend_shipment_confirmation_email" />
<argument type="service" id="security.csrf.token_manager" />
Expand All @@ -74,27 +74,27 @@
<argument type="service" id="twig" />
</service>

<service id="sylius_admin.controller.dashboard" class="Sylius\Bundle\AdminBundle\Controller\DashboardController" public="true">
<service id="sylius_admin.controller.dashboard" class="Sylius\Bundle\AdminBundle\Controller\DashboardController">
<argument type="service" id="sylius.repository.channel" />
<argument type="service" id="twig" />
<argument type="service" id="router" />
</service>

<service id="sylius_admin.controller.customer_statistics" class="Sylius\Bundle\AdminBundle\Controller\CustomerStatisticsController" public="true">
<service id="sylius_admin.controller.customer_statistics" class="Sylius\Bundle\AdminBundle\Controller\CustomerStatisticsController">
<argument type='service' id="sylius.provider.statistics.customer" />
<argument type='service' id="sylius.repository.customer" />
<argument type='service' id="twig" />
</service>

<service id="sylius_admin.controller.notification" class="Sylius\Bundle\AdminBundle\Controller\NotificationController" public="true">
<service id="sylius_admin.controller.notification" class="Sylius\Bundle\AdminBundle\Controller\NotificationController">
<argument type="service" id="sylius.http_client" />
<argument type="service" id="Psr\Http\Message\RequestFactoryInterface" />
<argument type="string">%sylius.admin.notification.uri%</argument>
<argument type="string">%kernel.environment%</argument>
<argument type="service" id="Psr\Http\Message\StreamFactoryInterface" />
</service>

<service id="sylius_admin.controller.remove_catalog_promotion" class="Sylius\Bundle\AdminBundle\Controller\RemoveCatalogPromotionAction" public="true">
<service id="sylius_admin.controller.remove_catalog_promotion" class="Sylius\Bundle\AdminBundle\Controller\RemoveCatalogPromotionAction">
<argument type="service" id="sylius.processor.catalog_promotion.removal" />
</service>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />

<service id="sylius_admin.mailer.email_manager.shipment" class="Sylius\Bundle\CoreBundle\Mailer\ShipmentEmailManager">
<argument type="service" id="sylius.email_sender" />
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

<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>
<defaults public="true" />

<service id="sylius_admin.grid_filter.ux_autocomplete" class="Sylius\Component\Grid\Filter\EntityFilter">
<tag name="sylius.grid_filter" type="ux_autocomplete" form-type="Sylius\Bundle\AdminBundle\Form\Type\Grid\Filter\UxAutocompleteFilterType" />
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />

<service id="sylius_admin.security.shop_user_impersonator" class="Sylius\Bundle\CoreBundle\Security\UserImpersonator" public="false">
<service id="sylius_admin.security.shop_user_impersonator" class="Sylius\Bundle\CoreBundle\Security\UserImpersonator">
<argument type="service" id="request_stack" />
<argument type="string">%sylius_shop.firewall_context_name%</argument>
<argument type="service" id="event_dispatcher" />
</service>
<service id="Sylius\Bundle\CoreBundle\Security\UserImpersonatorInterface" alias="sylius_admin.security.shop_user_impersonator" />

<service id="sylius_admin.controller.impersonate_user" class="Sylius\Bundle\AdminBundle\Controller\ImpersonateUserController">
<service id="sylius_admin.controller.impersonate_user" class="Sylius\Bundle\AdminBundle\Controller\ImpersonateUserController" public="true">
<argument type="service" id="sylius_admin.security.shop_user_impersonator" />
<argument type="service" id="security.authorization_checker" />
<argument type="service" id="sylius.shop_user_provider.email_or_name_based" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />

<service id="sylius_admin.menu_builder.main" class="Sylius\Bundle\AdminBundle\Menu\MainMenuBuilder">
<argument type="service" id="knp_menu.factory" />
<argument type="service" id="event_dispatcher" />
Expand Down
2 changes: 0 additions & 2 deletions src/Sylius/Bundle/ApiBundle/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
class="Sylius\Bundle\ApiBundle\ApiPlatform\Routing\IriConverter"
decorates="api_platform.symfony.iri_converter"
decoration-priority="64"
public="false"
>
<argument type="service" id=".inner" />
<argument type="service" id="sylius_api.provider.path_prefix" />
Expand All @@ -98,7 +97,6 @@
id="sylius_api.api_platform.routing.api_loader"
class="Sylius\Bundle\ApiBundle\ApiPlatform\Routing\ApiLoader"
decorates="api_platform.route_loader"
public="false"
>
<argument type="service" id=".inner" />
<argument>%sylius_api.operations_to_remove%</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />

<service id="sylius_api.provider.payment_configuration" class="Sylius\Bundle\ApiBundle\Provider\CompositePaymentConfigurationProvider">
<argument type="tagged_iterator" tag="sylius.api.payment_method_handler" />
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />

<service id="sylius_api.command_handler.account.register_shop_user" class="Sylius\Bundle\ApiBundle\CommandHandler\Account\RegisterShopUserHandler">
<argument type="service" id="sylius.factory.shop_user" />
<argument type="service" id="sylius.manager.shop_user" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="false" />

<service
id="sylius_api.context_builder.channel_code_aware"
class="Sylius\Bundle\ApiBundle\Serializer\ContextBuilder\ChannelCodeAwareContextBuilder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="false" />

<service id="sylius_api.context.user.token_based" class="Sylius\Bundle\ApiBundle\Context\TokenBasedUserContext">
<argument type="service" id="security.token_storage" />
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
</parameter>
</parameters>
<services>
<defaults public="true" />

<service id="sylius_api.provider.path_prefix" class="Sylius\Bundle\ApiBundle\Provider\PathPrefixProvider">
<argument>%sylius.security.api_route%</argument>
<argument>%sylius.api_path_prefixes%</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="false" />

<service id="sylius_api.section_resolver.admin_api_uri_based" class="Sylius\Bundle\ApiBundle\SectionResolver\AdminApiUriBasedSectionResolver">
<argument>%sylius.security.api_admin_route%</argument>
<tag name="sylius.uri_based_section_resolver" priority="30" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />

<service id="sylius_api.denormalizer.address" class="Sylius\Bundle\ApiBundle\Serializer\Denormalizer\AddressDenormalizer">
<argument type="service" id="serializer.normalizer.object" />
<argument type="string">%sylius.model.address.class%</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
</parameters>

<services>
<defaults public="true" />

<service id="sylius.doctrine.orm.event_subscriber.load_metadata.attribute" class="Sylius\Bundle\AttributeBundle\Doctrine\ORM\Subscriber\LoadMetadataSubscriber">
<service id="sylius.doctrine.orm.event_subscriber.load_metadata.attribute" class="Sylius\Bundle\AttributeBundle\Doctrine\ORM\Subscriber\LoadMetadataSubscriber" public="true">
<argument>%sylius.attribute.subjects%</argument>
<tag name="doctrine.event_subscriber" />
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />

<service id="sylius.attribute_type.text" class="Sylius\Component\Attribute\AttributeType\TextAttributeType">
<tag name="sylius.attribute.type" attribute-type="text" label="Text"
form-type="Sylius\Bundle\AttributeBundle\Form\Type\AttributeType\TextAttributeType"
Expand Down
14 changes: 6 additions & 8 deletions src/Sylius/Bundle/ChannelBundle/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
</parameters>

<services>
<defaults public="true" />

<service id="sylius.custom_factory.channel" class="Sylius\Component\Channel\Factory\ChannelFactory" decorates="sylius.factory.channel" decoration-priority="256" public="false">
<argument type="service" id="sylius.custom_factory.channel.inner" />
</service>
Expand All @@ -45,29 +43,29 @@
<tag name="form.type" />
</service>

<service id="sylius.context.channel.composite" class="Sylius\Component\Channel\Context\CompositeChannelContext" public="false" />
<service id="sylius.context.channel.composite" class="Sylius\Component\Channel\Context\CompositeChannelContext" />
<service id="Sylius\Component\Channel\Context\ChannelContextInterface" alias="sylius.context.channel" />

<service id="sylius.context.channel.request_based" class="Sylius\Component\Channel\Context\RequestBased\ChannelContext" public="false">
<service id="sylius.context.channel.request_based" class="Sylius\Component\Channel\Context\RequestBased\ChannelContext">
<argument type="service" id="sylius.context.channel.request_based.resolver" />
<argument type="service" id="request_stack" />
<tag name="sylius.context.channel" />
</service>

<service id="sylius.context.channel.single_channel" class="Sylius\Component\Channel\Context\SingleChannelContext" public="false">
<service id="sylius.context.channel.single_channel" class="Sylius\Component\Channel\Context\SingleChannelContext">
<argument type="service" id="sylius.repository.channel" />
<tag name="sylius.context.channel" priority="-128"/>
</service>

<service id="sylius.context.channel.request_based.resolver.composite" class="Sylius\Component\Channel\Context\RequestBased\CompositeRequestResolver" public="false"/>
<service id="sylius.context.channel.request_based.resolver.composite" class="Sylius\Component\Channel\Context\RequestBased\CompositeRequestResolver" />
<service id="Sylius\Component\Channel\Context\RequestBased\RequestResolverInterface" alias="sylius.context.channel.request_based.resolver.composite" />

<service id="sylius.context.channel.request_based.resolver.hostname_based" class="Sylius\Component\Channel\Context\RequestBased\HostnameBasedRequestResolver" public="false">
<service id="sylius.context.channel.request_based.resolver.hostname_based" class="Sylius\Component\Channel\Context\RequestBased\HostnameBasedRequestResolver">
<argument type="service" id="sylius.repository.channel" />
<tag name="sylius.context.channel.request_based.resolver" />
</service>

<service id="sylius.collector.channel" class="Sylius\Bundle\ChannelBundle\Collector\ChannelCollector" public="false">
<service id="sylius.collector.channel" class="Sylius\Bundle\ChannelBundle\Collector\ChannelCollector">
<argument type="service" id="sylius.repository.channel" />
<argument type="service" id="sylius.context.channel" />
<argument>false</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />

<service id="sylius.context.channel.fake_channel.persister" class="Sylius\Bundle\ChannelBundle\Context\FakeChannel\FakeChannelPersister">
<argument type="service" id="sylius.context.channel.fake_channel.code_provider" />
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" priority="-8192" />
Expand Down
Loading

0 comments on commit 82c2a57

Please sign in to comment.