Skip to content

Commit b091141

Browse files
committed
Add incorrect non static access of static property to AccessPropertiesRuleTest
1 parent 08465ec commit b091141

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/PHPStan/Rules/Properties/AccessPropertiesRuleTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,16 @@ public function testAccessPropertiesOnThisOnly(): void
344344
);
345345
}
346346

347+
public function testBug12692(): void
348+
{
349+
$this->checkThisOnly = false;
350+
$this->checkUnionTypes = false;
351+
$this->checkDynamicProperties = false;
352+
$this->analyse([__DIR__ . '/data/bug-12692.php'], [
353+
// This should not be empty!
354+
]);
355+
}
356+
347357
public function testAccessPropertiesAfterIsNullInBooleanOr(): void
348358
{
349359
$this->checkThisOnly = false;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Bug12692;
6+
7+
class Foo
8+
{
9+
10+
public static $static;
11+
12+
public function foo()
13+
{
14+
$this->static;
15+
}
16+
17+
}

0 commit comments

Comments
 (0)