Skip to content

Commit 066cbc9

Browse files
Add non regression test
1 parent 5878035 commit 066cbc9

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
@@ -1068,6 +1068,14 @@ public function testTraitMixin(): void
10681068
$this->analyse([__DIR__ . '/data/trait-mixin.php'], []);
10691069
}
10701070

1071+
public function testBug9706(): void
1072+
{
1073+
$this->checkThisOnly = false;
1074+
$this->checkUnionTypes = true;
1075+
$this->checkDynamicProperties = true;
1076+
$this->analyse([__DIR__ . '/data/bug-9706.php'], []);
1077+
}
1078+
10711079
#[RequiresPhp('>= 8.4')]
10721080
public function testAsymmetricVisibility(): void
10731081
{
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)