Skip to content

Commit 408d2b6

Browse files
committed
Fixed tests for PHP >= 8.0.
1 parent 26107db commit 408d2b6

File tree

3 files changed

+291
-134
lines changed

3 files changed

+291
-134
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
/**
@@ -61,6 +66,7 @@ public function test121(int $param1): bool
6166
*/
6267
public function test13(?int $param1): ?bool
6368
{
69+
return false;
6470
}
6571

6672
/**
@@ -70,6 +76,7 @@ public function test13(?int $param1): ?bool
7076
*/
7177
public function test131(?int $param1): ?bool
7278
{
79+
return false;
7380
}
7481

7582
/**
@@ -79,6 +86,7 @@ public function test131(?int $param1): ?bool
7986
*/
8087
public function test132(?int $param1): ?bool
8188
{
89+
return false;
8290
}
8391

8492
/**
@@ -88,6 +96,7 @@ public function test132(?int $param1): ?bool
8896
*/
8997
public function test14(int|float $param1): bool|int
9098
{
99+
return false;
91100
}
92101

93102
/**
@@ -97,6 +106,7 @@ public function test14(int|float $param1): bool|int
97106
*/
98107
public function test141(int|float $param1): bool|int
99108
{
109+
return false;
100110
}
101111

102112
/**
@@ -106,5 +116,6 @@ public function test141(int|float $param1): bool|int
106116
*/
107117
public function test141(int|float $param1): bool|int
108118
{
119+
return false;
109120
}
110121
}

0 commit comments

Comments
 (0)