-
-
Notifications
You must be signed in to change notification settings - Fork 739
[AddArrayReturnDocTypeRector] Allow mixed[] and iterable<mixed> in place of Rector's setting wrong infered types #2630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
TomasVotruba
merged 7 commits into
rectorphp:master
from
gnutix:AddArrayReturnDocTypeRector/fix-iterable-mixed
Jan 18, 2020
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8facc75
Fix AddArrayReturnDocTypeRector on @return iterable<mixed>.
gnutix 426dd6a
Fix CS.
gnutix 9874e80
Simplify the test case method for one that better illustrate the issue.
gnutix e073b9a
Add failing test case for mixed[] (return array).
gnutix 56c9d31
Fix it.
gnutix 4ba637f
Merge remote-tracking branch 'origin/master' into AddArrayReturnDocTy…
gnutix 0f3fc56
Split fixtures.
gnutix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
17 changes: 17 additions & 0 deletions
17
...ion/tests/Rector/ClassMethod/AddArrayReturnDocTypeRector/Fixture/skip_mixed_array.php.inc
This file contains hidden or 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,17 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\TypeDeclaration\Tests\Rector\ClassMethod\AddArrayReturnDocTypeRector\Fixture; | ||
|
|
||
| final class SkipMixedArray | ||
| { | ||
| /** | ||
| * @return mixed[] | ||
| */ | ||
| public function someMethod(): array | ||
| { | ||
| return [ | ||
| 42, | ||
| [42], | ||
| ]; | ||
| } | ||
| } | ||
15 changes: 15 additions & 0 deletions
15
.../tests/Rector/ClassMethod/AddArrayReturnDocTypeRector/Fixture/skip_mixed_iterable.php.inc
This file contains hidden or 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\TypeDeclaration\Tests\Rector\ClassMethod\AddArrayReturnDocTypeRector\Fixture; | ||
|
|
||
| final class SkipMixedIterable | ||
| { | ||
| /** | ||
| * @return iterable<mixed> | ||
| */ | ||
| public function someDataProvider(): iterable | ||
| { | ||
| yield [42]; | ||
| yield [[42]]; | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.