Commit graph

40757 commits

Author SHA1 Message Date
Grzegorz Sadowski
180de9d403
[Validator] Use constructor property promotion for constraint messages 2026-06-18 15:09:40 +02:00
Grzegorz Sadowski
1dcd199c39
[Validator] Rename constraint message options to consistent *Message convention 2026-06-18 14:05:37 +02:00
Grzegorz Sadowski
6a7a20f3e5
[ApiBundle] Restore configurable shippingAddressNotFoundMessage in ChosenShippingMethodEligibility 2026-06-18 14:05:28 +02:00
Grzegorz Sadowski
3e3409d423
[Maintenance] Add UPGRADE-2.3 notes for doctrine-bundle 3 and DBAL 4 2026-06-18 14:05:26 +02:00
Grzegorz Sadowski
5897846cbd
[Maintenance] Add UPGRADE-2.3 note about named arguments in validation constraints 2026-06-18 14:04:56 +02:00
Grzegorz Sadowski
a167cac1db
[Validator] Keep backward-compatible array options with a deprecation 2026-06-18 14:04:30 +02:00
Grzegorz Sadowski
e603a8c63e
[Attribute] Cast min/max to int in Text and Select attribute validation 2026-06-18 14:04:29 +02:00
Grzegorz Sadowski
da25e534a8
[Validator] Cover remaining constraints with named arguments 2026-06-18 14:04:29 +02:00
TheMilek
1c4f891a8c
Fix validation constraints
(cherry picked from commit 4c92845830)
2026-06-18 14:04:29 +02:00
TheMilek
d8b1554952
[SF8] Use named arguments for Validator constraint constructor
(cherry picked from commit 2dbad7b21e)
2026-06-18 14:04:29 +02:00
Jan Góralski
f745ee5aa0
Allow doctrine/doctrine-bundle ^3.0 and doctrine/dbal ^4.0 (#19064)
Some checks are pending
Continuous Integration (Minimal) / Static checks (push) Waiting to run
Continuous Integration (Minimal) / Tests (MariaDB) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Javascript Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (PostgreSQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Frontend (push) Blocked by required conditions
Continuous Integration (Minimal) / Packages (push) Blocked by required conditions
| Q               | A
|-----------------|-----
| Branch?         | 2.3
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations? | no<!-- don't forget to update the UPGRADE-*.md file
-->
| Related tickets | duplicates
https://github.com/Sylius/Sylius/pull/18754, partially
https://github.com/Sylius/Sylius/issues/18760
| License         | MIT

This PR is a duplication of #18754 (which targets the `symfony-8`
branch). It reuses that PR's commits to bring the broadened Doctrine
support into `2.3`.

### What it does

Widens the supported Doctrine stack, **opt-in via `||`, no minimum is
bumped**:

  - `doctrine/doctrine-bundle` `^2.13 || ^3.0`
  - `doctrine/dbal` `^3.9 || ^4.0`
  - `doctrine/persistence` `^3.3 || ^4.0`
  - `doctrine/data-fixtures` `^1.7 || ^2.2` (dev)

Plus the compatibility work the newer stack requires:

- DBAL 3.x/4.x compatibility layers (platform detection,
`getSchemaManager()` → `createSchemaManager()`,
    `SqlitePlatform`/`SQLitePlatform`, `QueryBuilder::select()`);
- a custom `ObjectType` registered as `object` (the built-in `object`
type was removed in DBAL 4),
covering the only two `type="object"` mappings:
`PaymentSecurityToken.details` and `PaymentRequest.payload`;
- config updates: removed `auto_generate_proxy_classes` (gone in
DoctrineBundle 3), PSR-6 cache pools,
and forced `SEQUENCE` identity generation on PostgreSQL to keep the
schema backward compatible;
  - CI matrix entries to test both DoctrineBundle 2 and 3.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
  * Added support for DoctrineBundle 3 and DBAL 4.
  * Added a custom DBAL “object” type to keep payment data compatible.
* **Documentation**
* Added Sylius 2.3 upgrade notes, including Doctrine cache pool
migration and PostgreSQL identity/sequence behavior.
* **Bug Fixes**
* Updated Doctrine ORM cache configuration to use Symfony cache pools
(production and test setups).
* Fixed timestamp handling to consistently store mutable `DateTime`
values where required.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-18 10:56:49 +02:00
Grzegorz Sadowski
8432f8edb4
[CoreBundle] Centralize all DQL platform checks in PlatformHelper 2026-06-18 10:09:06 +02:00
Grzegorz Sadowski
694c40d7ed
Document removed Doctrine cache provider services in UPGRADE-2.3 2026-06-18 06:51:30 +02:00
Grzegorz Sadowski
acc20b277a
Centralize SQLite platform detection, simplify platform name match, use LogicException 2026-06-18 06:26:24 +02:00
Grzegorz Sadowski
1ab6228718
[CoreBundle] Fix AtomicOrderPromotionsUsageModifier test for DBAL 4 LockMode enum 2026-06-18 06:16:31 +02:00
Grzegorz Sadowski
6dc94c9485
Update symfony.lock 2026-06-18 06:16:30 +02:00
Grzegorz Sadowski
8ff49b1faf
[Maintenance] Add UPGRADE-2.3 notes for doctrine-bundle 3 and DBAL 4 2026-06-18 06:16:28 +02:00
Grzegorz Sadowski
209016df32
[Payum] Preserve PaymentSecurityToken BC (revert details to untyped, use custom ObjectType) 2026-06-17 14:33:45 +02:00
TheMilek
3aad5d6fd7
Test doctrinebundle combinations
(cherry picked from commit 408a6bde4d)
2026-06-17 14:33:45 +02:00
TheMilek
5ded5aaff3
Make clock datetimeimmutable compatible with datetime type in mapping
(cherry picked from commit c1f02dd633)
2026-06-17 14:33:45 +02:00
TheMilek
03bd383c9f
Add custom ObjectType for DBAL 4.x compatibility
(cherry picked from commit 2e7d903606)
2026-06-17 14:33:45 +02:00
TheMilek
c976028ee7
Make test mocks compatible with DBAL 3 and 4
(cherry picked from commit e264fac021)
2026-06-17 14:33:44 +02:00
Rafikooo
bd364048bb
Fix DBAL 4.x mock compatibility in tests
- Update DriverMock::connect() signature for DBAL 4.x
- Add return types to DriverConnectionMock methods
- Add return types to StatementMock methods
- Add return types to DatabasePlatformMock methods

(cherry picked from commit 1c9cd7c243)
2026-06-17 14:33:44 +02:00
Rafikooo
c9c81f4b60
Fix DateTime to DateTimeImmutable for DBAL 4.x compatibility
- Use ClockInterface in UserLastLoginSubscriber instead of new DateTime()
- Update all test fixtures to use DateTimeImmutable
- Fix test code using DateTime for entity properties

(cherry picked from commit a01e7ef1eb)
2026-06-17 14:33:44 +02:00
Rafikooo
b8a6b7442b
Fix fixture factories for datetime_immutable DBAL type
DBAL 4.x strictly requires DateTimeImmutable for datetime_immutable
columns. This fixes:
- Fixture factories to use DateTimeImmutable::createFromMutable() for Faker dates
- AddressLogEntry to override Gedmo's setLoggedAt() with DateTimeImmutable

(cherry picked from commit 5d8fd73280)
2026-06-17 14:33:44 +02:00
Rafikooo
97c4a2ebb1
Fix DateTimeImmutable::sub() - assign return value
(cherry picked from commit 39c687ed0e)
2026-06-17 14:33:44 +02:00
Rafikooo
f92ec2b52b
Use DateTimeImmutable in model constructors for DBAL 4.x compatibility
(cherry picked from commit bbb6d00e2f)
2026-06-17 14:33:44 +02:00
Rafikooo
07409b4b80
Use PSR-6 cache pools directly for ORM 3.x compatibility
(cherry picked from commit 8fd759784a)
2026-06-17 14:33:43 +02:00
Rafikooo
d2b81c09cb
Align data-fixtures version in AddressingBundle
(cherry picked from commit 4bc86730f8)
2026-06-17 14:33:43 +02:00
Rafikooo
f2c28b746f
Allow doctrine/data-fixtures ^2.2 for persistence ^4 support
(cherry picked from commit 3102ec010c)
2026-06-17 14:33:43 +02:00
Rafikooo
84f6b4eedc
Use datetime_immutable Doctrine type for DBAL 4.x compatibility
(cherry picked from commit 07130603b1)
2026-06-17 14:33:43 +02:00
Rafikooo
6c30d0cf6e
Align doctrine-bundle version in bundle composer.json files
(cherry picked from commit 8861205149)
2026-06-17 14:33:43 +02:00
Rafikooo
e204f6a602
Move DBAL 3.x/4.x compatibility ignore to global phpstan config
(cherry picked from commit 2c61ba6353)
2026-06-17 14:33:43 +02:00
Rafikooo
c97ce1af28
Force DBAL 3.x for DoctrineBundle 2.x tests
DBAL 4.x has stricter type checking that doesn't accept DateTimeImmutable
in datetime fields. Until the codebase is fully compatible with DBAL 4.x,
we need to use DBAL 3.x for DoctrineBundle 2.x tests.

(cherry picked from commit 4abdd1c2a0)
2026-06-17 14:33:43 +02:00
Rafikooo
20bcf71b99
Remove auto_generate_proxy_classes config for DoctrineBundle 3.x compatibility
This option was removed in DoctrineBundle 3.0 as it became a no-op
when using native lazy objects (introduced in ORM 3.x/DBAL 4.x).

(cherry picked from commit 2c0b64e89c)
2026-06-17 14:33:42 +02:00
Rafikooo
260e14acfc
Require api-test-case ^5.3.5 (supports doctrine-bundle 3.x)
(cherry picked from commit f1da6da147)
2026-06-17 14:33:42 +02:00
Rafikooo
9f0edadf09
Allow doctrine/persistence ^3.3 || ^4.0
(cherry picked from commit 34e3d57043)
2026-06-17 14:33:42 +02:00
Rafikooo
f1e6d2ac35
Fix CI: whitelist MariaDb1027Platform in composer-require-checker
(cherry picked from commit dd8e57e5f3)
2026-06-17 14:33:42 +02:00
Rafikooo
f906fcba7f
Fix CI: Day/Hour DQL + QueryBuilder::select() for DBAL 4
(cherry picked from commit e20abd232d)
2026-06-17 14:33:42 +02:00
Rafikooo
a6972e5ae5
Add DBAL 3.x/4.x compatibility layer
(cherry picked from commit 23cc3a128b)
2026-06-17 14:33:42 +02:00
Rafikooo
cefe6f70a5
Add doctrine_bundle to CI matrix for testing both versions
(cherry picked from commit 966c64798b)
2026-06-17 14:33:41 +02:00
Rafikooo
ff84b9561d
Allow doctrine/doctrine-bundle ^2.0 || ^3.0
(cherry picked from commit a477872e88)
2026-06-17 14:33:41 +02:00
Kamil Grygierzec
499d84b607
[XML2PHP] StateMachineAbstraction (#19063)
Some checks are pending
Continuous Integration (Minimal) / Static checks (push) Waiting to run
Continuous Integration (Minimal) / Tests (MariaDB) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Javascript Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (PostgreSQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Frontend (push) Blocked by required conditions
Continuous Integration (Minimal) / Packages (push) Blocked by required conditions
| Q               | A
|-----------------|-----
| Branch?         | 2.3
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations? | no<!-- don't forget to update the UPGRADE-*.md file
-->
| Related tickets | extracted from
https://github.com/Sylius/Sylius/pull/18803, partially
https://github.com/Sylius/Sylius/issues/18490
| License         | MIT

<!--
 - Bug fixes must be submitted against the 2.2 branch
 - Features and deprecations must be submitted against the 2.3 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
-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Refactor**
* Migrated state machine service configurations from XML format to
PHP-based configuration files for improved maintainability and
consistency.
* Updated the service loader to support PHP file-based configuration
instead of XML.

* **Tests**
* Streamlined test coverage to focus on YAML-based service configuration
validation paths.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-17 13:12:49 +02:00
Kamil Grygierzec
dc63ff6b72
Remove symfony/proxy-manager-bridge and friendsofphp/proxy-manager-lts (#19062)
| Q               | A
|-----------------|-----
| Branch?         | 2.3
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | https://github.com/Sylius/Sylius/pull/18971,
https://github.com/Sylius/Sylius/issues/18760
| License         | MIT

This re-targets the already-open #18971 (originally against `symfony-8`)
onto `2.3`, since `2.3` is the development branch for the next release.
The original commit is cherry-picked as-is to preserve authorship.

`symfony/proxy-manager-bridge` and `friendsofphp/proxy-manager-lts` are
removed — they are no longer needed, as lazy services rely on PHP's
native lazy proxies from `symfony/var-exporter` (default since Symfony
6.4).

Adds an `UPGRADE-2.3.md` note under **Dependencies**.

<!--
 - Bug fixes must be submitted against the 2.2 branch
 - Features and deprecations must be submitted against the 2.3 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
-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
  * Added upgrade guidance for dependency changes in version 2.3.

* **Chores**
* Removed proxy manager bridge dependencies; lazy services now use
native PHP lazy proxies for improved performance and reduced external
dependencies.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-17 13:09:35 +02:00
Kamil Grygierzec
bc650c0606
Remove consolidation/robo dependency and refactor packages builds (#19060)
| Q               | A
|-----------------|-----
| Branch?         | 2.3
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations? | no<!-- don't forget to update the UPGRADE-*.md file
-->
| Related tickets | https://github.com/Sylius/Sylius/pull/18903,
https://github.com/Sylius/Sylius/issues/18760
| License         | MIT

This PR backports the robo removal already done on the `symfony-8`
branch (#18903) to `2.3`, as it makes sense to have it on `2.3` already

<!--
 - Bug fixes must be submitted against the 2.2 branch
 - Features and deprecations must be submitted against the 2.3 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
-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Refactored CI/CD workflows to dynamically discover and test packages
instead of using a task runner approach.
* Simplified package test execution with per-package working directories
and conditional test execution.
* Removed external task runner dependency to streamline the build
pipeline.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-17 12:39:06 +02:00
TheMilek
e6b7657122
[XML2PHP] StateMachineAbstraction 2026-06-17 06:24:02 +02:00
Grzegorz Sadowski
1624f51569
Document removal of proxy-manager packages in UPGRADE-2.3 2026-06-16 14:28:39 +02:00
Pascal CESCON - Amoifr
6b1b99b3fa
Remove symfony/proxy-manager-bridge and friendsofphp/proxy-manager-lts
These packages are no longer needed as Symfony 8 uses PHP 8.4 native
lazy proxies instead of the third-party proxy-manager library.
2026-06-16 14:23:36 +02:00
Grzegorz Sadowski
f4920e4c1d
[CI] Do not fail nightly on unstable Symfony 8 packages build 2026-06-16 13:59:13 +02:00
Grzegorz Sadowski
dcc76cea4a
[CI] Drop RoboFile.php export-ignore after robo removal 2026-06-16 13:58:56 +02:00