-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Skip ArrayDimFetch for return and param types (#5059)
* Create skip_phpdoc_shape.php.inc * Create skip_phpdoc_shape.php.inc
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...tor/ClassMethod/AddMethodCallBasedStrictParamTypeRector/Fixture/skip_phpdoc_shape.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,21 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture; | ||
|
||
final class SkipPhpdocArrayShape { | ||
private function doFoo() { | ||
$shape = $this->returnsShape(); | ||
$this->doBar($shape['hello']); | ||
} | ||
|
||
/** | ||
* @return array{'hello': string, 'world': int} | ||
*/ | ||
private function returnsShape() { | ||
|
||
} | ||
|
||
private function doBar($param) { | ||
|
||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../ClassMethod/ReturnTypeFromStrictScalarReturnExprRector/Fixture/skip_phpdoc_shape.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,18 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector\Fixture; | ||
|
||
final class SkipPhpdocArrayShape { | ||
private function doFoo() { | ||
$shape = $this->returnsShape(); | ||
return $shape['hello']; | ||
} | ||
|
||
/** | ||
* @return array{'hello': string, 'world': int} | ||
*/ | ||
private function returnsShape() { | ||
|
||
} | ||
|
||
} |