-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php80] Do not remove array<mixed> inside Union type on UnionTypesRec…
…tor (#2358) * [Php80] Do not remove array<mixed> inside Union type on UnionTypesRector * Fixed 🎉 * also allow mixed[] * clean up * clean up
- Loading branch information
1 parent
e1ecbe9
commit 4c53b20
Showing
6 changed files
with
64 additions
and
8 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
33 changes: 33 additions & 0 deletions
33
...Rector/FunctionLike/UnionTypesRector/Fixture/do_not_remove_doc_array_typed_mixed3.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,33 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\UnionTypesRector\Fixture; | ||
|
||
final class DoNotRemoveDocArrayTypedMixed3 | ||
{ | ||
/** | ||
* @param bool|float|int|string|mixed[] $value | ||
*/ | ||
public function normalizeNodeValue($value) | ||
{ | ||
return $value; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\UnionTypesRector\Fixture; | ||
|
||
final class DoNotRemoveDocArrayTypedMixed3 | ||
{ | ||
/** | ||
* @param bool|float|int|string|mixed[] $value | ||
*/ | ||
public function normalizeNodeValue(bool|float|int|string|array $value) | ||
{ | ||
return $value; | ||
} | ||
} | ||
|
||
?> |
15 changes: 15 additions & 0 deletions
15
rules-tests/Php80/Rector/FunctionLike/UnionTypesRector/Fixture/skip_with_array_mixed.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,15 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\UnionTypesRector\Fixture; | ||
|
||
final class SkipWithArrayMixed | ||
{ | ||
/** | ||
* @param object|array<mixed> $foo | ||
* @param array<mixed> $bar | ||
*/ | ||
public function run(object|array $foo, array $bar): int | ||
{ | ||
return 5; | ||
} | ||
} |
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