Skip to content

Conversation

@kiloumap
Copy link
Collaborator

@kiloumap kiloumap commented Jan 29, 2026

BREAKING CHANGES

  • Requires PHP 8.1+
  • Requires Doctrine ORM 3.6 (drops ORM 2.x support)
  • Requires Doctrine DBAL 4.4 (drops DBAL 3.x support)

Upgrade to Doctrine ORM 3.x and DBAL 4.x

  • Replace deprecated SQLLogger with DBAL middleware pattern for SQL profiling
  • Update mapping access from array syntax to object properties ($mapping['field'] → $mapping->field)
  • Replace AssociationMapping->type property with type() method
  • Use ClassMetadata::isIdentifier() instead of $fieldMapping->id
  • Update OnClearEventArgs usage (entity-specific clear removed in ORM 3.x)
  • Use DsnParser for database URL parsing (required in DBAL 4.x)
  • Replace deprecated schema methods (createSchema() → introspectSchema(), etc.)
  • Update migration files to extend AbstractMigration from new namespace

@kiloumap kiloumap marked this pull request as draft January 29, 2026 20:02
@kiloumap kiloumap force-pushed the migration/doctrine-3 branch 8 times, most recently from af5cd63 to 660baf4 Compare January 30, 2026 16:19
@kiloumap kiloumap marked this pull request as ready for review January 30, 2026 16:21
Copy link
Owner

@mpoiriert mpoiriert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes, could have merge with them but might as well fix it.

@kiloumap kiloumap force-pushed the migration/doctrine-3 branch 3 times, most recently from a042cec to e09f26d Compare February 2, 2026 15:53
Migrate from the deprecated SQLLogger interface (removed in DBAL 4.x)
to the new middleware system for SQL profiling in tests.

New classes:
- QueryCollector: Collects SQL queries
- ProfilingMiddleware: Entry point, tagged as doctrine.middleware
- ProfilingDriver: Wraps driver
- ProfilingConnection: Captures query/exec calls
- ProfilingStatement: Captures prepared statements

DoctrineOrmTrait:
- Add strict return types for ManagerRegistry compatibility with persistence 4.x
- Remove deprecated getAliasNamespace() method
- Replace deprecated Comparator with SchemaManager::createComparator()
- Replace createSchema() with introspectSchema()
- Replace toSaveSql() with Platform::getAlterSchemaSQL()
- Replace setPrimaryKey() with addPrimaryKeyConstraint()
- Replace prepare()->executeStatement() with executeStatement()
- Use array_push with spread operator for better performance
- In ORM 3.x, entity-specific clear is no longer supported
- OnClearEventArgs no longer has getEntityClass() method
- Replace prepare()->executeStatement() with executeStatement()
- Bump doctrine/dbal to ^4.4 and doctrine/orm to ^3.6
- Association mappings are now objects instead of arrays
- Replace array access with object property access
- Replace ClassMetadataInfo with ClassMetadata
- Use array_push with spread operator for better performance in loops
- Association and field mappings are now objects instead of arrays
- Replace array access with object property access
- Replace ClassMetadataInfo with ClassMetadata
- Bump doctrine/orm to ^3.6
- BigIntType::getBindingType() now returns ParameterType enum
- Association mappings are now objects instead of arrays
- Bump doctrine/orm to ^3.6 and doctrine/dbal to ^4.4
- Replace ClassMetadataInfo with ClassMetadata
- Bump doctrine/orm to ^3.6
- Replace ClassMetadataInfo with ClassMetadata
Root and package dependency upgrades:
- doctrine/dbal: ^3.3 → ^4.4
- doctrine/orm: ^2.11 → ^3.6
- doctrine/doctrine-bundle: ^2.5 → ^2.13
- doctrine/collections: ^1.0 → ^2.2
- knplabs/doctrine-behaviors: * → ^3.0
- sonata-project/doctrine-orm-admin-bundle: ^4.2 → ^4.19
Use security command on macOS instead of update-ca-certificates
for installing self-signed certificates.
@kiloumap kiloumap force-pushed the migration/doctrine-3 branch from e09f26d to da05214 Compare February 2, 2026 16:05
@kiloumap kiloumap dismissed mpoiriert’s stale review February 2, 2026 16:11

Everything has been fixed :)

@kiloumap kiloumap self-assigned this Feb 2, 2026
@kiloumap kiloumap requested a review from mpoiriert February 2, 2026 16:14
Copy link
Owner

@mpoiriert mpoiriert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the adjustment to PHPCs rule file.

@mpoiriert mpoiriert merged commit a51474e into mpoiriert:master Feb 2, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants