Skip to content

Commit 9693201

Browse files
staabmondrejmirtes
authored andcommitted
Added regression test
1 parent 00d2caf commit 9693201

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

tests/PHPStan/Rules/DeadCode/UnusedPrivatePropertyRuleTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,4 +315,11 @@ public function testBug10628(): void
315315
$this->analyse([__DIR__ . '/data/bug-10628.php'], []);
316316
}
317317

318+
public function testBug8781(): void
319+
{
320+
$this->alwaysWrittenTags = [];
321+
$this->alwaysReadTags = [];
322+
$this->analyse([__DIR__ . '/data/bug-8781.php'], []);
323+
}
324+
318325
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace Bug8781;
4+
5+
class ExecSync
6+
{
7+
/**
8+
* @var array<mixed>
9+
*/
10+
private $stdOut;
11+
12+
/**
13+
* @var string
14+
*/
15+
private $command;
16+
17+
/**
18+
* @param string $command
19+
*/
20+
public function __construct($command)
21+
{
22+
$this->command = $command;
23+
}
24+
25+
public function run(): void
26+
{
27+
exec($this->command, $this->stdOut);
28+
}
29+
30+
/**
31+
* @return array<mixed>
32+
*/
33+
public function wait(): array
34+
{
35+
return $this->stdOut;
36+
}
37+
}

0 commit comments

Comments
 (0)