Skip to content

Commit

Permalink
[TypeDeclaration] Test native-type ArrayDimFetch on numeric keys (#5063)
Browse files Browse the repository at this point in the history
* [TypeDeclaration] Test native-type ArrayDimFetch on numeric keys

* typo
  • Loading branch information
staabm committed Sep 21, 2023
1 parent c3d2ccf commit 40d127e
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture;

final class NativeArrayShape2 {
private function doFoo() {
$arr = [];
$arr[10] = 'foo';
$this->doBar($arr[10]);
}

private function doBar($param) {

}
}
?>
-----
<?php

namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture;

final class NativeArrayShape2 {
private function doFoo() {
$arr = [];
$arr[10] = 'foo';
$this->doBar($arr[10]);
}

private function doBar(string $param) {

}
}
?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture;

final class NativeArrayShape3 {
private function doFoo() {
$arr = [];
$arr[10] = [123.132];
$this->doBar($arr[10]);
}

private function doBar($param) {

}
}
?>
-----
<?php

namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture;

final class NativeArrayShape3 {
private function doFoo() {
$arr = [];
$arr[10] = [123.132];
$this->doBar($arr[10]);
}

private function doBar(array $param) {

}
}
?>

0 comments on commit 40d127e

Please sign in to comment.