Skip to content

Commit a26551c

Browse files
committed
Fixed build
1 parent e560d32 commit a26551c

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/Type/Doctrine/QueryBuilder/QueryBuilderGetDqlDynamicReturnTypeExtension.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PHPStan\Reflection\MethodReflection;
99
use PHPStan\Type\DynamicMethodReturnTypeExtension;
1010
use PHPStan\Type\Type;
11+
use PHPStan\Type\TypeCombinator;
1112

1213
class QueryBuilderGetDqlDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
1314
{
@@ -38,10 +39,12 @@ public function getTypeFromMethodCall(
3839
Scope $scope
3940
): Type
4041
{
41-
return $scope->getType(new MethodCall(
42+
$type = $scope->getType(new MethodCall(
4243
new MethodCall($methodCall->var, new Identifier('getQuery')),
4344
new Identifier('getDQL')
4445
));
46+
47+
return TypeCombinator::removeNull($type);
4548
}
4649

4750
}

tests/DoctrineIntegration/ODM/DocumentManagerIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getPhpStanExecutablePath(): string
3030
return __DIR__ . '/../../../vendor/bin/phpstan';
3131
}
3232

33-
public function getPhpStanConfigPath(): ?string
33+
public function getPhpStanConfigPath(): string
3434
{
3535
return __DIR__ . '/phpstan.neon';
3636
}

tests/DoctrineIntegration/ORM/EntityManagerIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function getPhpStanExecutablePath(): string
3131
return __DIR__ . '/../../../vendor/bin/phpstan';
3232
}
3333

34-
public function getPhpStanConfigPath(): ?string
34+
public function getPhpStanConfigPath(): string
3535
{
3636
return __DIR__ . '/phpstan.neon';
3737
}

tests/DoctrineIntegration/Persistence/ManagerRegistryIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function getPhpStanExecutablePath(): string
2727
return __DIR__ . '/../../../vendor/bin/phpstan';
2828
}
2929

30-
public function getPhpStanConfigPath(): ?string
30+
public function getPhpStanConfigPath(): string
3131
{
3232
return __DIR__ . '/phpstan.neon';
3333
}

0 commit comments

Comments
 (0)