Skip to content

Commit a6bb647

Browse files
VincentLangletondrejmirtes
authored andcommitted
Add non regression test
1 parent cfe73f1 commit a6bb647

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2733,6 +2733,19 @@ public function testBug8752(): void
27332733
]);
27342734
}
27352735

2736+
public function testBug8713(): void
2737+
{
2738+
if (PHP_VERSION_ID < 80000) {
2739+
$this->markTestSkipped('Test requires PHP 8.0');
2740+
}
2741+
2742+
$this->checkThisOnly = false;
2743+
$this->checkNullables = true;
2744+
$this->checkUnionTypes = true;
2745+
$this->checkExplicitMixed = true;
2746+
$this->analyse([__DIR__ . '/data/bug-8713.php'], []);
2747+
}
2748+
27362749
public function testCannotCallOnGenericClassString(): void
27372750
{
27382751
$this->checkThisOnly = false;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php // lint >= 8.0
2+
3+
namespace Bug8713;
4+
5+
class Foo
6+
{
7+
public function foo(): void
8+
{
9+
$query = "SELECT * FROM `foo`";
10+
$pdo = new \PDO("dsn");
11+
$pdo->query(query: $query);
12+
}
13+
}

0 commit comments

Comments
 (0)