Skip to content

Commit

Permalink
Updated order of mapping attribute parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Soltys committed Oct 9, 2023
1 parent f3b6c4b commit a7b9e8f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
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: `Doctrine\ORM\Proxy\ProxyFactory` no longer extends abstract factory from `doctrine/common`

It is no longer possible to call methods, constants or properties inherited
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

0 comments on commit a7b9e8f

Please sign in to comment.