Skip to content

Commit

Permalink
Make targetEntity mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed May 7, 2022
1 parent e1586ea commit 6ead3a5
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions lib/Doctrine/ORM/Mapping/ManyToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Attribute;
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
use Doctrine\Deprecations\Deprecation;

/**
* @Annotation
Expand Down Expand Up @@ -43,26 +42,18 @@ final class ManyToMany implements Annotation
public $indexBy;

/**
* @param class-string|null $targetEntity
* @param string[]|null $cascade
* @param class-string $targetEntity
* @param string[]|null $cascade
*/
public function __construct(
?string $targetEntity = null,
string $targetEntity,
?string $mappedBy = null,
?string $inversedBy = null,
?array $cascade = null,
string $fetch = 'LAZY',
bool $orphanRemoval = false,
?string $indexBy = null
) {
if ($targetEntity === null) {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/issues/8753',
'Passing no target entity is deprecated.'
);
}

$this->targetEntity = $targetEntity;
$this->mappedBy = $mappedBy;
$this->inversedBy = $inversedBy;
Expand Down

0 comments on commit 6ead3a5

Please sign in to comment.