From 5c2d83d587f32b36324c60d95d2da29de4126ffe Mon Sep 17 00:00:00 2001 From: Mateusz Zalewski Date: Mon, 14 Feb 2022 16:11:03 +0100 Subject: [PATCH 1/2] Update Sylius supported versions --- docs/book/organization/release-cycle.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/book/organization/release-cycle.rst b/docs/book/organization/release-cycle.rst index 282b8e43cd..48f8e882f1 100644 --- a/docs/book/organization/release-cycle.rst +++ b/docs/book/organization/release-cycle.rst @@ -67,6 +67,8 @@ Past Releases +---------+--------------------+--------------------+--------------------+-----------------------+ | 1.10 | Jun 29, 2021 | May 14, 2022 | Jan 14, 2023 | Fully supported | +---------+--------------------+--------------------+--------------------+-----------------------+ +| 1.11 | Feb 14, 2022 | Oct 13, 2022 | Jun 17, 2023 | Fully supported | ++---------+--------------------+--------------------+--------------------+-----------------------+ Future Releases --------------- @@ -74,7 +76,7 @@ Future Releases +---------+----------------------+------------------------+--------------------+ | Version | Development starts | Stabilization starts | Release date | +=========+======================+========================+====================+ -| 1.11 | Jun 29, 2021 | Dec 13, 2021 | Feb 14, 2022 | +| 1.12 | Feb 14, 2021 | To-be confirmed | To-be confirmed | +---------+----------------------+------------------------+--------------------+ Backward Compatibility From 6adb39d680252c5238e9ab0bdea9ff156dec55c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Chru=C5=9Bciel?= Date: Fri, 11 Feb 2022 15:39:53 +0100 Subject: [PATCH 2/2] [ADR] Declaring services as public in container --- ...2_02_11_declaring_services_in_container.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 adr/2022_02_11_declaring_services_in_container.md diff --git a/adr/2022_02_11_declaring_services_in_container.md b/adr/2022_02_11_declaring_services_in_container.md new file mode 100644 index 0000000000..baa5cf2715 --- /dev/null +++ b/adr/2022_02_11_declaring_services_in_container.md @@ -0,0 +1,53 @@ +# Declaring services in container + +* Status: accepted +* Date: 2022-02-11 + +## Context and Problem Statement + +Since Symfony 3.4, all Symfony services are declared private by default. And this is the recommended Symfony approach. On the +other hand, first stable Sylius release was published before that and therefore at the moment of publication of this recommendation +Sylius had hundreds public services. The question is how should we handle services declared after the 3.4 release. + +## Decision Drivers + +Declared services should be: +* easily usable in ResourceControllers (where we are allowing for fetching services directly from the container) +* easily usable as state machine callbacks, which are fetched directly for the container +* easily accessible in PHPUnit +* it would be better to have one, coherent rule for all services + +## Considered Options + +### Making all services public + +* Good, because it is coherent with previous services +* Good, because it is easily usable with ResourceController, StateMachines and PHPUnit +* Good, because it maintains backward compatibility +* Bad, because it is against Symfony recommendation + +### Making all service private + +* Good, because it is coherent with previous services +* Good, because it follows Symfony recommendation +* Bad, because it breaks backward compatibility +* Bad, because it requires additional code to rework ResourceController and StateMachines service handling +* Bad, because it requires small refactor for PHPUnit handling + +### Making only new services private + +* Good, because it follows Symfony recommendation for new stuff +* Good, because it maintains backward compatibility +* Bad, because it requires additional code to rework ResourceController and StateMachines service handling +* Bad, because it requires small refactor for PHPUnit handling + +## Decision Outcome + +Chosen option: **"Making all services public"** + +For now, it is the most straightforward solution, that does not cost us too much, does not put additional debt on us, and +it is the solution that we are doing since 3.4 (it was just implicit). + +## References + +* [Announcement of private services](https://symfony.com/blog/new-in-symfony-3-4-services-are-private-by-default)