Skip to content

Commit

Permalink
[TypeDeclaration] Skip ArrayDimFetch for return and param types (#5059)
Browse files Browse the repository at this point in the history
* Create skip_phpdoc_shape.php.inc

* Create skip_phpdoc_shape.php.inc
  • Loading branch information
staabm committed Sep 21, 2023
1 parent 9f88b63 commit 84916ed
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
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) {

}
}
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() {

}

}

0 comments on commit 84916ed

Please sign in to comment.