-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed type seen by IterableInForeachRule with inline @var right above…
… foreach
- Loading branch information
1 parent
d5e6df7
commit b6bbbaf
Showing
5 changed files
with
72 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Node; | ||
|
||
use PhpParser\Node\Stmt\Foreach_; | ||
use PhpParser\NodeAbstract; | ||
|
||
class InForeachNode extends NodeAbstract implements VirtualNode | ||
{ | ||
|
||
public function __construct(private Foreach_ $originalNode) | ||
{ | ||
parent::__construct($originalNode->getAttributes()); | ||
} | ||
|
||
public function getOriginalNode(): Foreach_ | ||
{ | ||
return $this->originalNode; | ||
} | ||
|
||
public function getType(): string | ||
{ | ||
return 'PHPStan_Node_InForeachNode'; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getSubNodeNames(): array | ||
{ | ||
return []; | ||
} | ||
|
||
} |
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,20 @@ | ||
<?php | ||
|
||
namespace Bug6564; | ||
|
||
class HelloWorld | ||
{ | ||
public function exportFileDataProvider(mixed $value): void | ||
{ | ||
if ($this->isValueIterable()) { | ||
/** @var mixed[] $value */ | ||
foreach ($value as $_value) { | ||
} | ||
} | ||
|
||
|
||
} | ||
public function isValueIterable(): bool { | ||
return true; | ||
} | ||
} |