Skip to content

Commit c6083f0

Browse files
committed
Fixed tests for PHP >= 8.0.
(cherry picked from commit 408d2b6)
1 parent ecf84c6 commit c6083f0

File tree

3 files changed

+291
-140
lines changed

3 files changed

+291
-140
lines changed

src/FileProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function processStatements(array $statements, string $prefix = '')
8282

8383
if ($statement instanceof Class_) {
8484
$class = $statement;
85-
$fullClassName = $prefix . '\\' . (string)$class->name;
85+
$fullClassName = $prefix . '\\' . $class->name;
8686

8787
$this->classes[$fullClassName] = [
8888
'file' => $this->file,

tests/data/TestClass.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ public function test1($param1)
1212

1313
public function test2(int $param1): bool
1414
{
15+
return false;
1516
}
1617

1718
public function test3(?int $param1): ?bool
1819
{
20+
return false;
1921
}
2022

2123
public function test4(int|float $param1): bool|int
2224
{
25+
return false;
2326
}
2427

2528
/**
@@ -43,15 +46,17 @@ public function test111($param1)
4346
*/
4447
public function test12(int $param1): bool
4548
{
49+
return false;
4650
}
4751

4852
/**
4953
* @param int|null $param1
5054
*
51-
* @return bool|null
55+
* @return bool|int
5256
*/
5357
public function test121(int $param1): bool
5458
{
59+
return false;
5560
}
5661

5762
/**
@@ -88,6 +93,7 @@ public function test124(int $param1): bool
8893
*/
8994
public function test13(?int $param1): ?bool
9095
{
96+
return false;
9197
}
9298

9399
/**
@@ -97,6 +103,7 @@ public function test13(?int $param1): ?bool
97103
*/
98104
public function test131(?int $param1): ?bool
99105
{
106+
return false;
100107
}
101108

102109
/**
@@ -106,6 +113,7 @@ public function test131(?int $param1): ?bool
106113
*/
107114
public function test132(?int $param1): ?bool
108115
{
116+
return false;
109117
}
110118

111119
/**
@@ -115,6 +123,7 @@ public function test132(?int $param1): ?bool
115123
*/
116124
public function test14(int|float $param1): bool|int
117125
{
126+
return false;
118127
}
119128

120129
/**
@@ -124,6 +133,7 @@ public function test14(int|float $param1): bool|int
124133
*/
125134
public function test141(int|float $param1): bool|int
126135
{
136+
return false;
127137
}
128138

129139
/**
@@ -133,5 +143,6 @@ public function test141(int|float $param1): bool|int
133143
*/
134144
public function test141(int|float $param1): bool|int
135145
{
146+
return false;
136147
}
137148
}

0 commit comments

Comments
 (0)