Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated order of mapping attribute parameters #10964

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Upgrade to 3.0

## Minor BC BREAK: Changed order of arguments passed to `OneToOne`, `ManyToOne` and `Index` mapping PHP attributes

To keep PHP mapping attributes consistent, order of arguments passed to above attributes has been changed
so `$targetEntity` is a first argument now. This change affects only non-named arguments usage.

## BC BREAK: AUTO keyword for identity generation defaults to IDENTITY for PostgreSQL now

When using the AUTO strategy to let Doctrine determine the identity generation mecehanism for
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ final class Index implements MappingAttribute
* @param array<string,mixed>|null $options
*/
public function __construct(
public readonly string|null $name = null,
public readonly array|null $columns = null,
public readonly array|null $fields = null,
public readonly string|null $name = null,
public readonly array|null $flags = null,
public readonly array|null $options = null,
) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/OneToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ final class OneToMany implements MappingAttribute
* @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch
*/
public function __construct(
public readonly string|null $mappedBy = null,
public readonly string|null $targetEntity = null,
public readonly string|null $mappedBy = null,
public readonly array|null $cascade = null,
public readonly string $fetch = 'LAZY',
public readonly bool $orphanRemoval = false,
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/OneToOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ final class OneToOne implements MappingAttribute
* @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch
*/
public function __construct(
public readonly string|null $targetEntity = null,
public readonly string|null $mappedBy = null,
public readonly string|null $inversedBy = null,
public readonly string|null $targetEntity = null,
public readonly array|null $cascade = null,
public readonly string $fetch = 'LAZY',
public readonly bool $orphanRemoval = false,
Expand Down