Skip to content

Commit 38c3ada

Browse files
committed
fixed compatibility with PhpStan 0.11
1 parent ba720d8 commit 38c3ada

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
],
77
"require": {
88
"php": "~7.1",
9-
"phpstan/phpstan": "~0.10"
9+
"phpstan/phpstan": "~0.11"
1010
},
1111
"require-dev": {
1212
"nette/tester": "~2.0",

src/Types/RepositoryReturnTypeExtension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ public function getTypeFromMethodCall(
8383
$entityType = new ObjectType(IEntity::class);
8484
} else {
8585
assert($entityClassNameTypes instanceof ConstantArrayType);
86-
$classNameType = $entityClassNameTypes->getFirstValueType();
86+
$classNameTypes = $entityClassNameTypes->getValueTypes();
87+
assert(count($classNameTypes) > 0);
88+
$classNameType = $classNameTypes[0];
8789
assert($classNameType instanceof ConstantStringType);
8890
$entityType = new ObjectType($classNameType->getValue());
8991
}

tests/test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
Environment::setup();
1212

13-
$command = __DIR__ . '/../vendor/bin/phpstan analyze --no-progress -l 7 -c ' . __DIR__ . '/config.neon --errorFormat rawSimple ' . __DIR__ . '/testbox';
13+
$command = __DIR__ . '/../vendor/bin/phpstan analyze --no-progress -l 7 -c ' . __DIR__ . '/config.neon --error-format rawSimple ' . __DIR__ . '/testbox';
1414
exec($command, $o);
1515
$actual = trim(implode("\n", $o));
1616
$expected = trim(file_get_contents(__DIR__ . '/expected.txt'));

0 commit comments

Comments
 (0)