Skip to content

Commit ee73a0b

Browse files
committed
regression test
1 parent e1b12a1 commit ee73a0b

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

tests/PHPStan/Rules/Properties/TypesAssignedToPropertiesRuleTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ class TypesAssignedToPropertiesRuleTest extends RuleTestCase
1414
{
1515

1616
private bool $checkExplicitMixed = false;
17+
private bool $checkImplicitMixed = false;
1718

1819
protected function getRule(): Rule
1920
{
20-
return new TypesAssignedToPropertiesRule(new RuleLevelHelper($this->createReflectionProvider(), true, false, true, $this->checkExplicitMixed, false, false, true), new PropertyReflectionFinder());
21+
return new TypesAssignedToPropertiesRule(new RuleLevelHelper($this->createReflectionProvider(), true, false, true, $this->checkExplicitMixed, $this->checkImplicitMixed, false, true), new PropertyReflectionFinder());
2122
}
2223

2324
public function testTypesAssignedToProperties(): void
@@ -789,4 +790,10 @@ public function testBug13093d(): void
789790
$this->analyse([__DIR__ . '/data/bug-13093d.php'], []);
790791
}
791792

793+
public function testBug8825(): void
794+
{
795+
$this->checkImplicitMixed = true;
796+
$this->analyse([__DIR__ . '/data/bug-8825.php'], []);
797+
}
798+
792799
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Bug8825;
4+
5+
class Endboss
6+
{
7+
8+
private bool $isBool;
9+
10+
/**
11+
* @param mixed[] $actionParameters
12+
*/
13+
public function __construct(
14+
array $actionParameters
15+
)
16+
{
17+
$this->isBool = $actionParameters['my_key'] ?? false;
18+
}
19+
20+
public function use(): void
21+
{
22+
$this->isBool->someMethod();
23+
}
24+
}

0 commit comments

Comments
 (0)