-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert Fix $this/self docblock compare removed on on-final class, as …
…it can refer to child this type (#1246) (#1669) * Revert Fix $this/self docblock compare removed on on-final class, as it can refer to child this type (#1246) This reverts commit a2c2979 * Fix handling of $this return type in UnionTypes rule `$this` refers to the exact object identity, not just the same type. Therefore, its valid and should not be removed @see https://wiki.php.net/rfc/this_return_type for more context
- Loading branch information
Showing
3 changed files
with
21 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...s/Php80/Rector/FunctionLike/UnionTypesRector/Fixture/skip_union_static_this_class.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\UnionTypesRector\Fixture; | ||
|
||
class SkipUnionStaticThisClass | ||
{ | ||
/** | ||
* @return $this | ||
*/ | ||
public function withFromId(int $fromId): static | ||
{ | ||
return $this; | ||
} | ||
} |