forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbug-8430b.php
More file actions
111 lines (105 loc) · 1.76 KB
/
bug-8430b.php
File metadata and controls
111 lines (105 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
declare(strict_types=1);
namespace Bug8430b;
class A
{
/** @var A[][] */
public array $a;
/** @var A[] */
public array $b;
/** @var array<string,string|string[]> */
public array $c;
public string $d;
}
class B
{
private function abc(): void
{
}
/**
* @param A[] $a
* @param array<string,string> $b
*/
public function def(array $a, array $b, string $c, bool $d): void
{
$e = false;
$f = false;
switch ($b['repeat'] ?? null) {
case 'Y':
$e = true;
break;
case 'A':
$e = true;
$f = true;
break;
}
$g = 5;
$h = 0;
for ($i = 1; $i <= $g; $i++) {
if (!$d) {
$arr = ['a' => 1];
}
$j = $a[$i] ?? null;
if ($j) {
/** @var array<A[]> $k */
$k = [];
if ($e) {
foreach ($j->a as $l) {
/** @var A[] $m */
$m = $f || empty($k) ? $j->b : [];
array_push($m, ...$l);
array_push($k, $m);
}
if (empty($k)) {
array_push($k, $j->b);
}
} else {
array_push($k, $j->b);
foreach ($j->a as $l) {
array_push($k[0], ...$l);
break;
}
}
foreach ($k as $n) {
if (!$d) {
foreach ($n as $o) {
switch ($o->c['x'] ?? '') {
case 'y':
$p = $o->c[$o->d] ?? null;
if (is_array($p)) {
$this->abc();
}
break;
case 'z':
$p = $o->c[$o->d] ?? null;
if (is_array($p)) {
$this->abc();
}
break;
default:
$this->abc();
break;
}
}
}
if (!empty($n)) {
$h++;
}
}
}
if (!$c && !$d) {
echo $arr['a'];
}
}
}
public function ghi(string $a, bool $b): void
{
if (!$b) {
$arr = ['a' => 1];
}
$this->abc();
if (!$a && !$b) {
echo $arr['a'];
}
}
}