-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php74] Do not remove array of type[] doc type on TypedPropertyRector…
… when php 8.0 feature enabled (#1811) * [Php74] Do not remove array of string doc type on TypedPropertyRector when php 8.0 feature enabled * update fixture * update fixture * Fixed 🎉 * [ci-review] Rector Rectify * remove array of mixed in doc in multiple with null * fixed 🎉 * clean up * clean up * clean up * clean up * final touch: move check to PhpDocTypeChanger to collect allowed types * phpstan * final touch: clean up * final touch: clean up * final touch: clean up, make recurisve Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
d3d562d
commit 9077ef4
Showing
6 changed files
with
105 additions
and
70 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
27 changes: 27 additions & 0 deletions
27
...opertyRector/FixtureUnionIntersectionTypes/do_not_remove_array_of_string_type_doc.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,27 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\Property\TypedPropertyRector\FixtureUnionIntersectionTypes; | ||
|
||
final class DoNotRemoveArrayOfStringTypeDoc | ||
{ | ||
/** | ||
* @var string|string[]|null | ||
*/ | ||
private $property; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\Property\TypedPropertyRector\FixtureUnionIntersectionTypes; | ||
|
||
final class DoNotRemoveArrayOfStringTypeDoc | ||
{ | ||
/** | ||
* @var string|string[]|null | ||
*/ | ||
private array|string|null $property = null; | ||
} | ||
|
||
?> |
24 changes: 24 additions & 0 deletions
24
...r/Property/TypedPropertyRector/FixtureUnionIntersectionTypes/remove_array_no_type.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,24 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\Property\TypedPropertyRector\FixtureUnionIntersectionTypes; | ||
|
||
final class RemoveArrayNoType | ||
{ | ||
/** | ||
* @var string|array|null | ||
*/ | ||
private $property; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\Property\TypedPropertyRector\FixtureUnionIntersectionTypes; | ||
|
||
final class RemoveArrayNoType | ||
{ | ||
private array|string|null $property = null; | ||
} | ||
|
||
?> |
27 changes: 27 additions & 0 deletions
27
...ixtureUnionIntersectionTypes/remove_array_of_mixed_type_doc_in_multiple_with_null.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,27 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\Property\TypedPropertyRector\FixtureUnionIntersectionTypes; | ||
|
||
final class DoNotRemoveArrayOfMixedTypeDocInMultipleWithNull | ||
{ | ||
/** | ||
* @var string|mixed[]|null | ||
*/ | ||
private $property; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\Property\TypedPropertyRector\FixtureUnionIntersectionTypes; | ||
|
||
final class DoNotRemoveArrayOfMixedTypeDocInMultipleWithNull | ||
{ | ||
/** | ||
* @var string|mixed[]|null | ||
*/ | ||
private array|string|null $property = null; | ||
} | ||
|
||
?> |
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