Skip to content

Commit 304ab0d

Browse files
VincentLangletondrejmirtes
authored andcommitted
Add non regression test
1 parent 4941982 commit 304ab0d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/PHPStan/Rules/Properties/AccessPropertiesRuleTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,14 @@ public function testTraitMixin(): void
10561056
$this->analyse([__DIR__ . '/data/trait-mixin.php'], []);
10571057
}
10581058

1059+
public function testBug9706(): void
1060+
{
1061+
$this->checkThisOnly = false;
1062+
$this->checkUnionTypes = true;
1063+
$this->checkDynamicProperties = true;
1064+
$this->analyse([__DIR__ . '/data/bug-9706.php'], []);
1065+
}
1066+
10591067
#[RequiresPhp('>= 8.4')]
10601068
public function testAsymmetricVisibility(): void
10611069
{
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace BUg9706;
4+
5+
class MissingDOMNamedNodeMapProperty
6+
{
7+
public function test(): void
8+
{
9+
$node = new \DOMElement('div');
10+
$attributes = $node->attributes;
11+
// According to the php.net docs, $length should be a public read-only property.
12+
// See https://www.php.net/manual/en/class.domnamednodemap.php
13+
$length = $attributes->length;
14+
}
15+
}

0 commit comments

Comments
 (0)