Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit 3bcb0c2

Browse files
committed
Merge branch 'update-phpstan' into master
2 parents d15e9a7 + d00a20a commit 3bcb0c2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"type": "phpstan-extension",
1515
"require": {
1616
"php": ">=7.2",
17-
"phpstan/phpstan": "^0.12-dev"
17+
"phpstan/phpstan": "^0.12"
1818
},
1919
"require-dev": {
2020
"eloquent/code-style": "^1",

src/Type/AcceptsMockTypes.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use PhpParser\Node\Arg;
88
use PhpParser\Node\Expr\Array_;
9+
use PhpParser\Node\Expr\ArrayItem;
910
use PhpParser\Node\Expr\ClassConstFetch;
1011
use PhpParser\Node\Name;
1112
use PHPStan\Analyser\Scope;
@@ -39,6 +40,10 @@ private function getClassListFromMockTypesArg(
3940
$classes = [];
4041

4142
foreach ($argValue->items as $item) {
43+
if (!$item instanceof ArrayItem) {
44+
continue;
45+
}
46+
4247
$itemValue = $item->value;
4348

4449
if (!$itemValue instanceof ClassConstFetch) {

0 commit comments

Comments
 (0)