diff --git a/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/CompanySQLFilter.php b/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/CompanySQLFilter.php index e65188334a..32fe98ea2b 100644 --- a/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/CompanySQLFilter.php +++ b/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/CompanySQLFilter.php @@ -11,14 +11,14 @@ class CompanySQLFilter extends SQLFilter { - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias): string + public function addFilterConstraint(ClassMetadata $targetEntity, string $targetTableAlias): string { if ($targetEntity->getName() === User::class) { - return sprintf('%s.%s = %s', $targetTableAlias, $targetEntity->fieldMappings['company']['fieldName'], $this->getParameter('company')); + return sprintf('%s.%s = %s', $targetTableAlias, $targetEntity->fieldMappings['company']->fieldName, $this->getParameter('company')); } if ($targetEntity->getName() === Order::class) { - return sprintf('%s.%s = %s', $targetTableAlias, $targetEntity->fieldMappings['company']['fieldName'], $this->getParameter('company')); + return sprintf('%s.%s = %s', $targetTableAlias, $targetEntity->fieldMappings['company']->fieldName, $this->getParameter('company')); } return ''; diff --git a/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/Order.php b/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/Order.php index a6d86dca8a..57bbfda480 100644 --- a/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/Order.php +++ b/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/Order.php @@ -6,34 +6,20 @@ use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity - * @ORM\Table(name="Order_Master") - */ +#[ORM\Entity] +#[ORM\Table('Order_Master')] class Order { - /** - * @ORM\Id - * @ORM\Column(type="integer") - * @ORM\GeneratedValue(strategy="AUTO") - * - * @var int - */ - public $id; + #[ORM\Id] + #[ORM\Column(type: 'integer')] + #[ORM\GeneratedValue(strategy: 'AUTO')] + public int $id; - /** - * @ORM\Column(type="string") - * - * @var string - */ - public $company; + #[ORM\Column(type: 'string')] + public string $company; - /** - * @ORM\ManyToOne(targetEntity="User", fetch="EAGER") - * - * @var User - */ - public $user; + #[ORM\ManyToOne(targetEntity: User::class, fetch: 'EAGER')] + public User $user; public function __construct(User $user) { diff --git a/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/User.php b/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/User.php index 294bfdf87a..6c3ceda127 100644 --- a/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/User.php +++ b/tests/Tests/ORM/Functional/Ticket/SwitchContextWithFilter/User.php @@ -6,27 +6,17 @@ use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity - * @ORM\Table(name="User_Master") - */ +#[ORM\Entity] +#[ORM\Table('User_Master')] class User { - /** - * @ORM\Id - * @ORM\Column(type="integer") - * @ORM\GeneratedValue(strategy="AUTO") - * - * @var int - */ - public $id; + #[ORM\Id] + #[ORM\Column(type: 'integer')] + #[ORM\GeneratedValue(strategy: 'AUTO')] + public int $id; - /** - * @ORM\Column(type="string") - * - * @var string - */ - public $company; + #[ORM\Column(type: 'string')] + public string $company; public function __construct(string $company) {