diff --git a/src/Util/ClassSourceManipulator.php b/src/Util/ClassSourceManipulator.php index 9164d7f34..39fdc427e 100644 --- a/src/Util/ClassSourceManipulator.php +++ b/src/Util/ClassSourceManipulator.php @@ -1073,7 +1073,7 @@ private function makeMethodFluent(Builder\Method $methodBuilder): void $methodBuilder ->addStmt($this->createBlankLineNode(self::CONTEXT_CLASS_METHOD)) ->addStmt(new Node\Stmt\Return_(new Node\Expr\Variable('this'))); - $methodBuilder->setReturnType('self'); + $methodBuilder->setReturnType('static'); } private function isInSameNamespace(string $class): bool diff --git a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/BaseClient.php b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/BaseClient.php index 9c5d0728b..99bf377fe 100644 --- a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/BaseClient.php +++ b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/BaseClient.php @@ -38,7 +38,7 @@ public function getName(): ?string return $this->name; } - public function setName(string $name): self + public function setName(string $name): static { $this->name = $name; @@ -50,7 +50,7 @@ public function getMagic(): ?int return $this->magic; } - public function setMagic(int $magic): self + public function setMagic(int $magic): static { $this->magic = $magic; @@ -62,7 +62,7 @@ public function getCreator(): ?User return $this->creator; } - public function setCreator(?User $creator): self + public function setCreator(?User $creator): static { $this->creator = $creator; diff --git a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/Client.php b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/Client.php index 313668d4c..7a3cbfd6d 100644 --- a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/Client.php +++ b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/Client.php @@ -35,7 +35,7 @@ public function getEmbed(): Embed return $this->embed; } - public function setEmbed(Embed $embed): self + public function setEmbed(Embed $embed): static { $this->embed = $embed; @@ -47,7 +47,7 @@ public function getApiKey(): ?string return $this->apiKey; } - public function setApiKey(string $apiKey): self + public function setApiKey(string $apiKey): static { $this->apiKey = $apiKey; @@ -62,7 +62,7 @@ public function getTags(): Collection return $this->tags; } - public function addTag(Tag $tag): self + public function addTag(Tag $tag): static { if (!$this->tags->contains($tag)) { $this->tags->add($tag); @@ -71,7 +71,7 @@ public function addTag(Tag $tag): self return $this; } - public function removeTag(Tag $tag): self + public function removeTag(Tag $tag): static { $this->tags->removeElement($tag); diff --git a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/Embed.php b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/Embed.php index 2bf4e3fab..ad1acf5cc 100644 --- a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/Embed.php +++ b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/Embed.php @@ -16,7 +16,7 @@ public function getVal(): ?int return $this->val; } - public function setVal(int $val): self + public function setVal(int $val): static { $this->val = $val; diff --git a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/User.php b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/User.php index c7d42e9c9..d98450ad7 100644 --- a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/User.php +++ b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/User.php @@ -53,7 +53,7 @@ public function getAvatars(): Collection return $this->avatars; } - public function addAvatar(UserAvatar $avatar): self + public function addAvatar(UserAvatar $avatar): static { if (!$this->avatars->contains($avatar)) { $this->avatars->add($avatar); @@ -63,7 +63,7 @@ public function addAvatar(UserAvatar $avatar): self return $this; } - public function removeAvatar(UserAvatar $avatar): self + public function removeAvatar(UserAvatar $avatar): static { if ($this->avatars->removeElement($avatar)) { // set the owning side to null (unless already changed) @@ -88,7 +88,7 @@ public function getTags(): Collection return $this->tags; } - public function addTag(Tag $tag): self + public function addTag(Tag $tag): static { if (!$this->tags->contains($tag)) { $this->tags->add($tag); @@ -97,7 +97,7 @@ public function addTag(Tag $tag): self return $this; } - public function removeTag(Tag $tag): self + public function removeTag(Tag $tag): static { $this->tags->removeElement($tag); diff --git a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/UserAvatar.php b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/UserAvatar.php index 842b8a588..5348dce52 100644 --- a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/UserAvatar.php +++ b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/UserAvatar.php @@ -26,7 +26,7 @@ public function getUser(): ?User return $this->user; } - public function setUser(?User $user): self + public function setUser(?User $user): static { $this->user = $user; diff --git a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/UserProfile.php b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/UserProfile.php index ae6aa9140..a846c206c 100644 --- a/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/UserProfile.php +++ b/tests/Doctrine/fixtures/expected_no_overwrite/src/Entity/UserProfile.php @@ -27,7 +27,7 @@ public function getUser(): ?User return $this->user; } - public function setUser(User $user): self + public function setUser(User $user): static { $this->user = $user; diff --git a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/BaseClient.php b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/BaseClient.php index 4d3fa6775..108137862 100644 --- a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/BaseClient.php +++ b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/BaseClient.php @@ -38,7 +38,7 @@ public function getName(): ?string return $this->name; } - public function setName(string $name): self + public function setName(string $name): static { $this->name = $name; @@ -50,7 +50,7 @@ public function getMagic(): ?int return $this->magic; } - public function setMagic(int $magic): self + public function setMagic(int $magic): static { $this->magic = $magic; @@ -62,7 +62,7 @@ public function getCreator(): ?User return $this->creator; } - public function setCreator(?User $creator): self + public function setCreator(?User $creator): static { $this->creator = $creator; diff --git a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/Client.php b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/Client.php index 313668d4c..7a3cbfd6d 100644 --- a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/Client.php +++ b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/Client.php @@ -35,7 +35,7 @@ public function getEmbed(): Embed return $this->embed; } - public function setEmbed(Embed $embed): self + public function setEmbed(Embed $embed): static { $this->embed = $embed; @@ -47,7 +47,7 @@ public function getApiKey(): ?string return $this->apiKey; } - public function setApiKey(string $apiKey): self + public function setApiKey(string $apiKey): static { $this->apiKey = $apiKey; @@ -62,7 +62,7 @@ public function getTags(): Collection return $this->tags; } - public function addTag(Tag $tag): self + public function addTag(Tag $tag): static { if (!$this->tags->contains($tag)) { $this->tags->add($tag); @@ -71,7 +71,7 @@ public function addTag(Tag $tag): self return $this; } - public function removeTag(Tag $tag): self + public function removeTag(Tag $tag): static { $this->tags->removeElement($tag); diff --git a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/Embed.php b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/Embed.php index 2bf4e3fab..ad1acf5cc 100644 --- a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/Embed.php +++ b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/Embed.php @@ -16,7 +16,7 @@ public function getVal(): ?int return $this->val; } - public function setVal(int $val): self + public function setVal(int $val): static { $this->val = $val; diff --git a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/User.php b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/User.php index 297782224..2339dd6f8 100644 --- a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/User.php +++ b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/User.php @@ -39,7 +39,7 @@ public function customMethod() return ''; } - public function setUserProfile(?UserProfile $userProfile): self + public function setUserProfile(?UserProfile $userProfile): static { // unset the owning side of the relation if necessary if ($userProfile === null && $this->userProfile !== null) { @@ -64,7 +64,7 @@ public function getAvatars(): Collection return $this->avatars; } - public function addAvatar(UserAvatar $avatar): self + public function addAvatar(UserAvatar $avatar): static { if (!$this->avatars->contains($avatar)) { $this->avatars->add($avatar); @@ -74,7 +74,7 @@ public function addAvatar(UserAvatar $avatar): self return $this; } - public function removeAvatar(UserAvatar $avatar): self + public function removeAvatar(UserAvatar $avatar): static { if ($this->avatars->removeElement($avatar)) { // set the owning side to null (unless already changed) @@ -99,7 +99,7 @@ public function getTags(): Collection return $this->tags; } - public function addTag(Tag $tag): self + public function addTag(Tag $tag): static { if (!$this->tags->contains($tag)) { $this->tags->add($tag); @@ -108,7 +108,7 @@ public function addTag(Tag $tag): self return $this; } - public function removeTag(Tag $tag): self + public function removeTag(Tag $tag): static { $this->tags->removeElement($tag); diff --git a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/UserAvatar.php b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/UserAvatar.php index 842b8a588..5348dce52 100644 --- a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/UserAvatar.php +++ b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/UserAvatar.php @@ -26,7 +26,7 @@ public function getUser(): ?User return $this->user; } - public function setUser(?User $user): self + public function setUser(?User $user): static { $this->user = $user; diff --git a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/UserProfile.php b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/UserProfile.php index ae6aa9140..a846c206c 100644 --- a/tests/Doctrine/fixtures/expected_overwrite/src/Entity/UserProfile.php +++ b/tests/Doctrine/fixtures/expected_overwrite/src/Entity/UserProfile.php @@ -27,7 +27,7 @@ public function getUser(): ?User return $this->user; } - public function setUser(User $user): self + public function setUser(User $user): static { $this->user = $user; diff --git a/tests/Doctrine/fixtures/expected_xml/src/Entity/UserAvatar.php b/tests/Doctrine/fixtures/expected_xml/src/Entity/UserAvatar.php index e572cc332..870219707 100644 --- a/tests/Doctrine/fixtures/expected_xml/src/Entity/UserAvatar.php +++ b/tests/Doctrine/fixtures/expected_xml/src/Entity/UserAvatar.php @@ -18,7 +18,7 @@ public function getUser(): ?UserXml return $this->user; } - public function setUser(?UserXml $user): self + public function setUser(?UserXml $user): static { $this->user = $user; diff --git a/tests/Doctrine/fixtures/expected_xml/src/Entity/UserXml.php b/tests/Doctrine/fixtures/expected_xml/src/Entity/UserXml.php index a231e00a5..aa40b7ed0 100644 --- a/tests/Doctrine/fixtures/expected_xml/src/Entity/UserXml.php +++ b/tests/Doctrine/fixtures/expected_xml/src/Entity/UserXml.php @@ -29,7 +29,7 @@ public function getName(): ?string return $this->name; } - public function setName(string $name): self + public function setName(string $name): static { $this->name = $name; @@ -44,7 +44,7 @@ public function getAvatars(): Collection return $this->avatars; } - public function addAvatar(UserAvatar $avatar): self + public function addAvatar(UserAvatar $avatar): static { if (!$this->avatars->contains($avatar)) { $this->avatars->add($avatar); @@ -54,7 +54,7 @@ public function addAvatar(UserAvatar $avatar): self return $this; } - public function removeAvatar(UserAvatar $avatar): self + public function removeAvatar(UserAvatar $avatar): static { if ($this->avatars->removeElement($avatar)) { // set the owning side to null (unless already changed) diff --git a/tests/Security/fixtures/expected/UserEntityWithEmailAsIdentifier.php b/tests/Security/fixtures/expected/UserEntityWithEmailAsIdentifier.php index 79ab96ace..4323dd8da 100644 --- a/tests/Security/fixtures/expected/UserEntityWithEmailAsIdentifier.php +++ b/tests/Security/fixtures/expected/UserEntityWithEmailAsIdentifier.php @@ -36,7 +36,7 @@ public function getEmail(): ?string return $this->email; } - public function setEmail(string $email): self + public function setEmail(string $email): static { $this->email = $email; @@ -65,7 +65,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -80,7 +80,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/UserEntityWithPassword.php b/tests/Security/fixtures/expected/UserEntityWithPassword.php index 305f10da9..550880696 100644 --- a/tests/Security/fixtures/expected/UserEntityWithPassword.php +++ b/tests/Security/fixtures/expected/UserEntityWithPassword.php @@ -41,7 +41,7 @@ public function getUserIdentifier(): string return (string) $this->userIdentifier; } - public function setUserIdentifier(string $userIdentifier): self + public function setUserIdentifier(string $userIdentifier): static { $this->userIdentifier = $userIdentifier; @@ -60,7 +60,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -75,7 +75,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/UserEntityWithUser_IdentifierAsIdentifier.php b/tests/Security/fixtures/expected/UserEntityWithUser_IdentifierAsIdentifier.php index c99e09a66..544c42c1c 100644 --- a/tests/Security/fixtures/expected/UserEntityWithUser_IdentifierAsIdentifier.php +++ b/tests/Security/fixtures/expected/UserEntityWithUser_IdentifierAsIdentifier.php @@ -41,7 +41,7 @@ public function getUserIdentifier(): string return (string) $this->user_identifier; } - public function setUserIdentifier(string $user_identifier): self + public function setUserIdentifier(string $user_identifier): static { $this->user_identifier = $user_identifier; @@ -60,7 +60,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -75,7 +75,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/UserEntityWithoutPassword.php b/tests/Security/fixtures/expected/UserEntityWithoutPassword.php index 3a30d54be..5e0a406e0 100644 --- a/tests/Security/fixtures/expected/UserEntityWithoutPassword.php +++ b/tests/Security/fixtures/expected/UserEntityWithoutPassword.php @@ -34,7 +34,7 @@ public function getUserIdentifier(): string return (string) $this->userIdentifier; } - public function setUserIdentifier(string $userIdentifier): self + public function setUserIdentifier(string $userIdentifier): static { $this->userIdentifier = $userIdentifier; @@ -53,7 +53,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; diff --git a/tests/Security/fixtures/expected/UserModelWithEmailAsIdentifier.php b/tests/Security/fixtures/expected/UserModelWithEmailAsIdentifier.php index 61629b51b..08d22f02c 100644 --- a/tests/Security/fixtures/expected/UserModelWithEmailAsIdentifier.php +++ b/tests/Security/fixtures/expected/UserModelWithEmailAsIdentifier.php @@ -21,7 +21,7 @@ public function getEmail(): ?string return $this->email; } - public function setEmail(string $email): self + public function setEmail(string $email): static { $this->email = $email; @@ -50,7 +50,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -65,7 +65,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/UserModelWithPassword.php b/tests/Security/fixtures/expected/UserModelWithPassword.php index fe38e6b00..4b5da8b08 100644 --- a/tests/Security/fixtures/expected/UserModelWithPassword.php +++ b/tests/Security/fixtures/expected/UserModelWithPassword.php @@ -26,7 +26,7 @@ public function getUserIdentifier(): string return (string) $this->userIdentifier; } - public function setUserIdentifier(string $userIdentifier): self + public function setUserIdentifier(string $userIdentifier): static { $this->userIdentifier = $userIdentifier; @@ -45,7 +45,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -60,7 +60,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/UserModelWithoutPassword.php b/tests/Security/fixtures/expected/UserModelWithoutPassword.php index 30d0d1c8a..ba898a3b3 100644 --- a/tests/Security/fixtures/expected/UserModelWithoutPassword.php +++ b/tests/Security/fixtures/expected/UserModelWithoutPassword.php @@ -20,7 +20,7 @@ public function getUserIdentifier(): string return (string) $this->userIdentifier; } - public function setUserIdentifier(string $userIdentifier): self + public function setUserIdentifier(string $userIdentifier): static { $this->userIdentifier = $userIdentifier; @@ -39,7 +39,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; diff --git a/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithEmailAsIdentifier.php b/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithEmailAsIdentifier.php index ba7a61242..d1882d3db 100644 --- a/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithEmailAsIdentifier.php +++ b/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithEmailAsIdentifier.php @@ -36,7 +36,7 @@ public function getEmail(): ?string return $this->email; } - public function setEmail(string $email): self + public function setEmail(string $email): static { $this->email = $email; @@ -73,7 +73,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -88,7 +88,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithPassword.php b/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithPassword.php index 690febcd2..f78869df5 100644 --- a/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithPassword.php +++ b/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithPassword.php @@ -41,7 +41,7 @@ public function getUserIdentifier(): string return (string) $this->userIdentifier; } - public function setUserIdentifier(string $userIdentifier): self + public function setUserIdentifier(string $userIdentifier): static { $this->userIdentifier = $userIdentifier; @@ -68,7 +68,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -83,7 +83,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithUser_IdentifierAsIdentifier.php b/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithUser_IdentifierAsIdentifier.php index 452792c0a..345f0b668 100644 --- a/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithUser_IdentifierAsIdentifier.php +++ b/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithUser_IdentifierAsIdentifier.php @@ -41,7 +41,7 @@ public function getUserIdentifier(): string return (string) $this->user_identifier; } - public function setUserIdentifier(string $user_identifier): self + public function setUserIdentifier(string $user_identifier): static { $this->user_identifier = $user_identifier; @@ -68,7 +68,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -83,7 +83,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithoutPassword.php b/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithoutPassword.php index 3993cba2f..f79fffc1f 100644 --- a/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithoutPassword.php +++ b/tests/Security/fixtures/expected/legacy_5_user_class/UserEntityWithoutPassword.php @@ -34,7 +34,7 @@ public function getUserIdentifier(): string return (string) $this->userIdentifier; } - public function setUserIdentifier(string $userIdentifier): self + public function setUserIdentifier(string $userIdentifier): static { $this->userIdentifier = $userIdentifier; @@ -61,7 +61,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; diff --git a/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithEmailAsIdentifier.php b/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithEmailAsIdentifier.php index ef3d1ae21..9338b4e7c 100644 --- a/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithEmailAsIdentifier.php +++ b/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithEmailAsIdentifier.php @@ -21,7 +21,7 @@ public function getEmail(): ?string return $this->email; } - public function setEmail(string $email): self + public function setEmail(string $email): static { $this->email = $email; @@ -58,7 +58,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -73,7 +73,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithPassword.php b/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithPassword.php index 357d20966..e57abb498 100644 --- a/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithPassword.php +++ b/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithPassword.php @@ -26,7 +26,7 @@ public function getUserIdentifier(): string return (string) $this->userIdentifier; } - public function setUserIdentifier(string $userIdentifier): self + public function setUserIdentifier(string $userIdentifier): static { $this->userIdentifier = $userIdentifier; @@ -53,7 +53,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; @@ -68,7 +68,7 @@ public function getPassword(): string return $this->password; } - public function setPassword(string $password): self + public function setPassword(string $password): static { $this->password = $password; diff --git a/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithoutPassword.php b/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithoutPassword.php index 98285e7b6..be4531b6e 100644 --- a/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithoutPassword.php +++ b/tests/Security/fixtures/expected/legacy_5_user_class/UserModelWithoutPassword.php @@ -20,7 +20,7 @@ public function getUserIdentifier(): string return (string) $this->userIdentifier; } - public function setUserIdentifier(string $userIdentifier): self + public function setUserIdentifier(string $userIdentifier): static { $this->userIdentifier = $userIdentifier; @@ -47,7 +47,7 @@ public function getRoles(): array return array_unique($roles); } - public function setRoles(array $roles): self + public function setRoles(array $roles): static { $this->roles = $roles; diff --git a/tests/Util/fixtures/add_entity_field/User_simple.php b/tests/Util/fixtures/add_entity_field/User_simple.php index ff480db71..93a5b9a42 100644 --- a/tests/Util/fixtures/add_entity_field/User_simple.php +++ b/tests/Util/fixtures/add_entity_field/User_simple.php @@ -25,7 +25,7 @@ public function getFooProp(): ?string return $this->fooProp; } - public function setFooProp(string $fooProp): self + public function setFooProp(string $fooProp): static { $this->fooProp = $fooProp; diff --git a/tests/Util/fixtures/add_entity_field/User_simple_datetime.php b/tests/Util/fixtures/add_entity_field/User_simple_datetime.php index df79e2120..ed572c903 100644 --- a/tests/Util/fixtures/add_entity_field/User_simple_datetime.php +++ b/tests/Util/fixtures/add_entity_field/User_simple_datetime.php @@ -26,7 +26,7 @@ public function getCreatedAt(): ?\DateTimeInterface return $this->createdAt; } - public function setCreatedAt(?\DateTimeInterface $createdAt): self + public function setCreatedAt(?\DateTimeInterface $createdAt): static { $this->createdAt = $createdAt; diff --git a/tests/Util/fixtures/add_entity_field/User_simple_object.php b/tests/Util/fixtures/add_entity_field/User_simple_object.php index 95586069d..0ed05a87b 100644 --- a/tests/Util/fixtures/add_entity_field/User_simple_object.php +++ b/tests/Util/fixtures/add_entity_field/User_simple_object.php @@ -26,7 +26,7 @@ public function getSomeObject(): ?object return $this->someObject; } - public function setSomeObject(object $someObject): self + public function setSomeObject(object $someObject): static { $this->someObject = $someObject; diff --git a/tests/Util/fixtures/add_entity_field/User_simple_prop_already_exists.php b/tests/Util/fixtures/add_entity_field/User_simple_prop_already_exists.php index 934ff545c..e6f6230d4 100644 --- a/tests/Util/fixtures/add_entity_field/User_simple_prop_already_exists.php +++ b/tests/Util/fixtures/add_entity_field/User_simple_prop_already_exists.php @@ -31,7 +31,7 @@ public function getFirstName() return $this->firstName; } - public function setFirstName(string $firstName): self + public function setFirstName(string $firstName): static { $this->firstName = $firstName; diff --git a/tests/Util/fixtures/add_entity_field/User_simple_prop_zero.php b/tests/Util/fixtures/add_entity_field/User_simple_prop_zero.php index d533c9afb..016430175 100644 --- a/tests/Util/fixtures/add_entity_field/User_simple_prop_zero.php +++ b/tests/Util/fixtures/add_entity_field/User_simple_prop_zero.php @@ -26,7 +26,7 @@ public function getDecimal(): ?string return $this->decimal; } - public function setDecimal(string $decimal): self + public function setDecimal(string $decimal): static { $this->decimal = $decimal; diff --git a/tests/Util/fixtures/add_entity_field/User_simple_ulid.php b/tests/Util/fixtures/add_entity_field/User_simple_ulid.php index f3db00a49..fbc876967 100644 --- a/tests/Util/fixtures/add_entity_field/User_simple_ulid.php +++ b/tests/Util/fixtures/add_entity_field/User_simple_ulid.php @@ -26,7 +26,7 @@ public function getUlid(): ?Ulid return $this->ulid; } - public function setUlid(Ulid $ulid): self + public function setUlid(Ulid $ulid): static { $this->ulid = $ulid; diff --git a/tests/Util/fixtures/add_entity_field/User_simple_uuid.php b/tests/Util/fixtures/add_entity_field/User_simple_uuid.php index 642b1ce95..73e0a69f5 100644 --- a/tests/Util/fixtures/add_entity_field/User_simple_uuid.php +++ b/tests/Util/fixtures/add_entity_field/User_simple_uuid.php @@ -26,7 +26,7 @@ public function getUuid(): ?Uuid return $this->uuid; } - public function setUuid(Uuid $uuid): self + public function setUuid(Uuid $uuid): static { $this->uuid = $uuid; diff --git a/tests/Util/fixtures/add_many_to_many_relation/User_simple_inverse.php b/tests/Util/fixtures/add_many_to_many_relation/User_simple_inverse.php index 213269398..762a033ba 100644 --- a/tests/Util/fixtures/add_many_to_many_relation/User_simple_inverse.php +++ b/tests/Util/fixtures/add_many_to_many_relation/User_simple_inverse.php @@ -35,7 +35,7 @@ public function getRecipes(): Collection return $this->recipes; } - public function addRecipe(Recipe $recipe): self + public function addRecipe(Recipe $recipe): static { if (!$this->recipes->contains($recipe)) { $this->recipes->add($recipe); @@ -45,7 +45,7 @@ public function addRecipe(Recipe $recipe): self return $this; } - public function removeRecipe(Recipe $recipe): self + public function removeRecipe(Recipe $recipe): static { if ($this->recipes->removeElement($recipe)) { $recipe->removeFood($this); diff --git a/tests/Util/fixtures/add_many_to_many_relation/User_simple_no_inverse.php b/tests/Util/fixtures/add_many_to_many_relation/User_simple_no_inverse.php index 2e1552f02..2be35be3e 100644 --- a/tests/Util/fixtures/add_many_to_many_relation/User_simple_no_inverse.php +++ b/tests/Util/fixtures/add_many_to_many_relation/User_simple_no_inverse.php @@ -35,7 +35,7 @@ public function getRecipes(): Collection return $this->recipes; } - public function addRecipe(Recipe $recipe): self + public function addRecipe(Recipe $recipe): static { if (!$this->recipes->contains($recipe)) { $this->recipes->add($recipe); @@ -44,7 +44,7 @@ public function addRecipe(Recipe $recipe): self return $this; } - public function removeRecipe(Recipe $recipe): self + public function removeRecipe(Recipe $recipe): static { $this->recipes->removeElement($recipe); diff --git a/tests/Util/fixtures/add_many_to_many_relation/User_simple_owning.php b/tests/Util/fixtures/add_many_to_many_relation/User_simple_owning.php index ba108b19f..99e785950 100644 --- a/tests/Util/fixtures/add_many_to_many_relation/User_simple_owning.php +++ b/tests/Util/fixtures/add_many_to_many_relation/User_simple_owning.php @@ -35,7 +35,7 @@ public function getRecipes(): Collection return $this->recipes; } - public function addRecipe(Recipe $recipe): self + public function addRecipe(Recipe $recipe): static { if (!$this->recipes->contains($recipe)) { $this->recipes->add($recipe); @@ -44,7 +44,7 @@ public function addRecipe(Recipe $recipe): self return $this; } - public function removeRecipe(Recipe $recipe): self + public function removeRecipe(Recipe $recipe): static { $this->recipes->removeElement($recipe); diff --git a/tests/Util/fixtures/add_many_to_one_relation/User_empty_other_namespace.php b/tests/Util/fixtures/add_many_to_one_relation/User_empty_other_namespace.php index 9ed23b7a2..3f0ba73ab 100644 --- a/tests/Util/fixtures/add_many_to_one_relation/User_empty_other_namespace.php +++ b/tests/Util/fixtures/add_many_to_one_relation/User_empty_other_namespace.php @@ -14,7 +14,7 @@ public function getCategory(): ?Category return $this->category; } - public function setCategory(?Category $category): self + public function setCategory(?Category $category): static { $this->category = $category; diff --git a/tests/Util/fixtures/add_many_to_one_relation/User_simple_no_inverse.php b/tests/Util/fixtures/add_many_to_one_relation/User_simple_no_inverse.php index 440245695..41d2dd6b6 100644 --- a/tests/Util/fixtures/add_many_to_one_relation/User_simple_no_inverse.php +++ b/tests/Util/fixtures/add_many_to_one_relation/User_simple_no_inverse.php @@ -25,7 +25,7 @@ public function getCategory(): ?Category return $this->category; } - public function setCategory(?Category $category): self + public function setCategory(?Category $category): static { $this->category = $category; diff --git a/tests/Util/fixtures/add_many_to_one_relation/User_simple_not_nullable.php b/tests/Util/fixtures/add_many_to_one_relation/User_simple_not_nullable.php index 573d9cad2..bedf4171e 100644 --- a/tests/Util/fixtures/add_many_to_one_relation/User_simple_not_nullable.php +++ b/tests/Util/fixtures/add_many_to_one_relation/User_simple_not_nullable.php @@ -26,7 +26,7 @@ public function getCategory(): ?Category return $this->category; } - public function setCategory(?Category $category): self + public function setCategory(?Category $category): static { $this->category = $category; diff --git a/tests/Util/fixtures/add_many_to_one_relation/User_simple_nullable.php b/tests/Util/fixtures/add_many_to_one_relation/User_simple_nullable.php index 94e11d44e..8b160022b 100644 --- a/tests/Util/fixtures/add_many_to_one_relation/User_simple_nullable.php +++ b/tests/Util/fixtures/add_many_to_one_relation/User_simple_nullable.php @@ -25,7 +25,7 @@ public function getCategory(): ?Category return $this->category; } - public function setCategory(?Category $category): self + public function setCategory(?Category $category): static { $this->category = $category; diff --git a/tests/Util/fixtures/add_many_to_one_relation/User_simple_other_namespace.php b/tests/Util/fixtures/add_many_to_one_relation/User_simple_other_namespace.php index b52ddd8e8..23aaf029c 100644 --- a/tests/Util/fixtures/add_many_to_one_relation/User_simple_other_namespace.php +++ b/tests/Util/fixtures/add_many_to_one_relation/User_simple_other_namespace.php @@ -26,7 +26,7 @@ public function getCategory(): ?Category return $this->category; } - public function setCategory(?Category $category): self + public function setCategory(?Category $category): static { $this->category = $category; diff --git a/tests/Util/fixtures/add_many_to_one_relation/User_with_relation_same_and_other_namespaces.php b/tests/Util/fixtures/add_many_to_one_relation/User_with_relation_same_and_other_namespaces.php index dffc6e7d9..ae773c912 100644 --- a/tests/Util/fixtures/add_many_to_one_relation/User_with_relation_same_and_other_namespaces.php +++ b/tests/Util/fixtures/add_many_to_one_relation/User_with_relation_same_and_other_namespaces.php @@ -19,7 +19,7 @@ public function getCategory(): ?Category return $this->category; } - public function setCategory(?Category $category): self + public function setCategory(?Category $category): static { $this->category = $category; @@ -31,7 +31,7 @@ public function getSubCategory(): ?\App\Entity\SubDirectory\Category return $this->subCategory; } - public function setSubCategory(?\App\Entity\SubDirectory\Category $subCategory): self + public function setSubCategory(?\App\Entity\SubDirectory\Category $subCategory): static { $this->subCategory = $subCategory; diff --git a/tests/Util/fixtures/add_one_to_many_relation/User_simple.php b/tests/Util/fixtures/add_one_to_many_relation/User_simple.php index c1e7f2598..e742e7ef0 100644 --- a/tests/Util/fixtures/add_one_to_many_relation/User_simple.php +++ b/tests/Util/fixtures/add_one_to_many_relation/User_simple.php @@ -35,7 +35,7 @@ public function getAvatarPhotos(): Collection return $this->avatarPhotos; } - public function addAvatarPhoto(UserAvatarPhoto $avatarPhoto): self + public function addAvatarPhoto(UserAvatarPhoto $avatarPhoto): static { if (!$this->avatarPhotos->contains($avatarPhoto)) { $this->avatarPhotos->add($avatarPhoto); @@ -45,7 +45,7 @@ public function addAvatarPhoto(UserAvatarPhoto $avatarPhoto): self return $this; } - public function removeAvatarPhoto(UserAvatarPhoto $avatarPhoto): self + public function removeAvatarPhoto(UserAvatarPhoto $avatarPhoto): static { if ($this->avatarPhotos->removeElement($avatarPhoto)) { // set the owning side to null (unless already changed) diff --git a/tests/Util/fixtures/add_one_to_many_relation/User_simple_orphan_removal.php b/tests/Util/fixtures/add_one_to_many_relation/User_simple_orphan_removal.php index 7145324ac..e76e70d81 100644 --- a/tests/Util/fixtures/add_one_to_many_relation/User_simple_orphan_removal.php +++ b/tests/Util/fixtures/add_one_to_many_relation/User_simple_orphan_removal.php @@ -35,7 +35,7 @@ public function getAvatarPhotos(): Collection return $this->avatarPhotos; } - public function addAvatarPhoto(UserAvatarPhoto $avatarPhoto): self + public function addAvatarPhoto(UserAvatarPhoto $avatarPhoto): static { if (!$this->avatarPhotos->contains($avatarPhoto)) { $this->avatarPhotos->add($avatarPhoto); @@ -45,7 +45,7 @@ public function addAvatarPhoto(UserAvatarPhoto $avatarPhoto): self return $this; } - public function removeAvatarPhoto(UserAvatarPhoto $avatarPhoto): self + public function removeAvatarPhoto(UserAvatarPhoto $avatarPhoto): static { if ($this->avatarPhotos->removeElement($avatarPhoto)) { // set the owning side to null (unless already changed) diff --git a/tests/Util/fixtures/add_one_to_many_relation/User_with_use_statements.php b/tests/Util/fixtures/add_one_to_many_relation/User_with_use_statements.php index b48b4e187..698741299 100644 --- a/tests/Util/fixtures/add_one_to_many_relation/User_with_use_statements.php +++ b/tests/Util/fixtures/add_one_to_many_relation/User_with_use_statements.php @@ -38,7 +38,7 @@ public function getAvatarPhotos(): Collection return $this->avatarPhotos; } - public function addAvatarPhoto(UserAvatarPhoto $avatarPhoto): self + public function addAvatarPhoto(UserAvatarPhoto $avatarPhoto): static { if (!$this->avatarPhotos->contains($avatarPhoto)) { $this->avatarPhotos->add($avatarPhoto); @@ -48,7 +48,7 @@ public function addAvatarPhoto(UserAvatarPhoto $avatarPhoto): self return $this; } - public function removeAvatarPhoto(UserAvatarPhoto $avatarPhoto): self + public function removeAvatarPhoto(UserAvatarPhoto $avatarPhoto): static { if ($this->avatarPhotos->removeElement($avatarPhoto)) { // set the owning side to null (unless already changed) diff --git a/tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse.php b/tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse.php index bd1239ef5..923536fca 100644 --- a/tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse.php +++ b/tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse.php @@ -26,7 +26,7 @@ public function getUser(): ?User return $this->user; } - public function setUser(?User $user): self + public function setUser(?User $user): static { // unset the owning side of the relation if necessary if ($user === null && $this->user !== null) { diff --git a/tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse_not_nullable.php b/tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse_not_nullable.php index 6a019a6e1..9438633aa 100644 --- a/tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse_not_nullable.php +++ b/tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse_not_nullable.php @@ -26,7 +26,7 @@ public function getUser(): ?User return $this->user; } - public function setUser(User $user): self + public function setUser(User $user): static { // set the owning side of the relation if necessary if ($user->getUserProfile() !== $this) { diff --git a/tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse.php b/tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse.php index d68fb6567..e8ccb84c1 100644 --- a/tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse.php +++ b/tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse.php @@ -25,7 +25,7 @@ public function getUserProfile(): ?UserProfile return $this->userProfile; } - public function setUserProfile(?UserProfile $userProfile): self + public function setUserProfile(?UserProfile $userProfile): static { $this->userProfile = $userProfile; diff --git a/tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse_not_nullable.php b/tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse_not_nullable.php index 61323c26e..6f2461e23 100644 --- a/tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse_not_nullable.php +++ b/tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse_not_nullable.php @@ -26,7 +26,7 @@ public function getUserProfile(): ?UserProfile return $this->userProfile; } - public function setUserProfile(UserProfile $userProfile): self + public function setUserProfile(UserProfile $userProfile): static { $this->userProfile = $userProfile; diff --git a/tests/Util/fixtures/add_one_to_one_relation/User_simple_owning.php b/tests/Util/fixtures/add_one_to_one_relation/User_simple_owning.php index c300f6d43..2d4cb6d50 100644 --- a/tests/Util/fixtures/add_one_to_one_relation/User_simple_owning.php +++ b/tests/Util/fixtures/add_one_to_one_relation/User_simple_owning.php @@ -25,7 +25,7 @@ public function getUserProfile(): ?UserProfile return $this->userProfile; } - public function setUserProfile(?UserProfile $userProfile): self + public function setUserProfile(?UserProfile $userProfile): static { $this->userProfile = $userProfile; diff --git a/tests/Util/fixtures/add_one_to_one_relation/User_simple_self.php b/tests/Util/fixtures/add_one_to_one_relation/User_simple_self.php index 7d09a37b1..22e44cc9d 100644 --- a/tests/Util/fixtures/add_one_to_one_relation/User_simple_self.php +++ b/tests/Util/fixtures/add_one_to_one_relation/User_simple_self.php @@ -25,7 +25,7 @@ public function getEmbeddedUser(): ?self return $this->embeddedUser; } - public function setEmbeddedUser(?self $embeddedUser): self + public function setEmbeddedUser(?self $embeddedUser): static { $this->embeddedUser = $embeddedUser; diff --git a/tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use.php b/tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use.php index 84e714852..a3fb0adca 100644 --- a/tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use.php +++ b/tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use.php @@ -29,7 +29,7 @@ public function getUserProfile(): ?\App\OtherEntity\UserProfile return $this->userProfile; } - public function setUserProfile(?\App\OtherEntity\UserProfile $userProfile): self + public function setUserProfile(?\App\OtherEntity\UserProfile $userProfile): static { $this->userProfile = $userProfile; diff --git a/tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use_alias.php b/tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use_alias.php index 6dfe111a7..6cbbe307f 100644 --- a/tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use_alias.php +++ b/tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use_alias.php @@ -29,7 +29,7 @@ public function getCategory(): ?\App\OtherEntity\Category return $this->category; } - public function setCategory(?\App\OtherEntity\Category $category): self + public function setCategory(?\App\OtherEntity\Category $category): static { $this->category = $category; diff --git a/tests/Util/fixtures/add_setter/User_empty.php b/tests/Util/fixtures/add_setter/User_empty.php index 98b413edf..8f38463fc 100644 --- a/tests/Util/fixtures/add_setter/User_empty.php +++ b/tests/Util/fixtures/add_setter/User_empty.php @@ -4,7 +4,7 @@ class User { - public function setFooProp(string $fooProp): self + public function setFooProp(string $fooProp): static { $this->fooProp = $fooProp; diff --git a/tests/Util/fixtures/add_setter/User_no_props.php b/tests/Util/fixtures/add_setter/User_no_props.php index cb262e569..cb7beed3c 100644 --- a/tests/Util/fixtures/add_setter/User_no_props.php +++ b/tests/Util/fixtures/add_setter/User_no_props.php @@ -18,7 +18,7 @@ public function hello() * @param string $fooProp * @internal */ - public function setFooProp(?string $fooProp): self + public function setFooProp(?string $fooProp): static { $this->fooProp = $fooProp; diff --git a/tests/Util/fixtures/add_setter/User_simple.php b/tests/Util/fixtures/add_setter/User_simple.php index 95d527e1a..7dac0211a 100644 --- a/tests/Util/fixtures/add_setter/User_simple.php +++ b/tests/Util/fixtures/add_setter/User_simple.php @@ -17,7 +17,7 @@ public function getId(): ?int return $this->id; } - public function setFooProp(string $fooProp): self + public function setFooProp(string $fooProp): static { $this->fooProp = $fooProp; diff --git a/tests/Util/fixtures/add_setter/User_simple_null_type.php b/tests/Util/fixtures/add_setter/User_simple_null_type.php index 644b3855a..932dadba8 100644 --- a/tests/Util/fixtures/add_setter/User_simple_null_type.php +++ b/tests/Util/fixtures/add_setter/User_simple_null_type.php @@ -17,7 +17,7 @@ public function getId(): ?int return $this->id; } - public function setFooProp($fooProp): self + public function setFooProp($fooProp): static { $this->fooProp = $fooProp; diff --git a/tests/Util/fixtures/source/User_with_relation.php b/tests/Util/fixtures/source/User_with_relation.php index 05a034ad8..8f8a15419 100644 --- a/tests/Util/fixtures/source/User_with_relation.php +++ b/tests/Util/fixtures/source/User_with_relation.php @@ -16,7 +16,7 @@ public function getCategory(): ?Category return $this->category; } - public function setCategory(?Category $category): self + public function setCategory(?Category $category): static { $this->category = $category;