-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WrongVariableNameInVarTagRule - fix iteratee variable above foreach
- Loading branch information
1 parent
8b2bc59
commit 3d365fc
Showing
7 changed files
with
63 additions
and
9 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Bug4504TypeInference; | ||
|
||
use function PHPStan\Analyser\assertType; | ||
|
||
class Foo | ||
{ | ||
|
||
public function sayHello($models): void | ||
{ | ||
/** @var \Iterator<A> $models */ | ||
foreach ($models as $k => $v) { | ||
assertType('Bug4504TypeInference\A', $v); | ||
} | ||
|
||
assertType('array()|Iterator<mixed, Bug4504TypeInference\A>', $models); | ||
} | ||
|
||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Bug4504; | ||
|
||
class Foo | ||
{ | ||
|
||
public function sayHello($models): void | ||
{ | ||
/** @var \Iterator<A> $models */ | ||
foreach ($models as $k => $v) { | ||
|
||
} | ||
} | ||
|
||
} |
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