Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 24, 2024
1 parent 776038d commit 4b66f5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleSlowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use PHPStan\Type\Doctrine\ObjectMetadataResolver;
use const PHP_VERSION_ID;

/**
* @extends RuleTestCase<QueryBuilderDqlRule>
Expand All @@ -22,6 +23,9 @@ protected function getRule(): Rule

public function testRule(): void
{
if (PHP_VERSION_ID < 70300) {
self::markTestSkipped('For some reason PHP 7.2 cannot recover from Trying to get property value of non-object');
}
$this->analyse([__DIR__ . '/data/query-builder-dql.php'], [
[
"QueryBuilder: [Syntax Error] line 0, col 66: Error: Expected end of string, got ')'\nDQL: SELECT e FROM PHPStan\Rules\Doctrine\ORM\MyEntity e WHERE e.id = 1)",
Expand Down
5 changes: 5 additions & 0 deletions tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use PHPStan\Type\Doctrine\ObjectMetadataResolver;
use const PHP_VERSION_ID;

/**
* @extends RuleTestCase<QueryBuilderDqlRule>
Expand All @@ -22,6 +23,10 @@ protected function getRule(): Rule

public function testRule(): void
{
if (PHP_VERSION_ID < 70300) {
self::markTestSkipped('For some reason PHP 7.2 cannot recover from Trying to get property value of non-object');
}

$this->analyse([__DIR__ . '/data/query-builder-dql.php'], [
[
"QueryBuilder: [Syntax Error] line 0, col 66: Error: Expected end of string, got ')'\nDQL: SELECT e FROM PHPStan\Rules\Doctrine\ORM\MyEntity e WHERE e.id = 1)",
Expand Down

0 comments on commit 4b66f5c

Please sign in to comment.