Skip to content

Commit 5cb00c8

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: fix test method name [DebugClassLoader] Ignore __constructor() when checking return types
2 parents 2da1c10 + cbe3798 commit 5cb00c8

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

DebugClassLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,10 @@ private function getOwnInterfaces(string $class, ?string $parent): array
753753

754754
private function setReturnType(string $types, string $class, string $method, string $filename, ?string $parent, \ReflectionType $returnType = null): void
755755
{
756+
if ('__construct' === $method) {
757+
return;
758+
}
759+
756760
if ($nullable = 0 === strpos($types, 'null|')) {
757761
$types = substr($types, 5);
758762
} elseif ($nullable = '|null' === substr($types, -5)) {

Tests/Fixtures/ReturnType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
class ReturnType extends ReturnTypeParent implements ReturnTypeInterface, Fixtures\OutsideInterface
99
{
10+
public function __construct() { }
1011
public function returnTypeGrandParent() { }
1112
public function returnTypeParentInterface() { }
1213
public function returnTypeInterface() { }

Tests/Fixtures/ReturnTypeParent.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
abstract class ReturnTypeParent extends ReturnTypeGrandParent implements ReturnTypeParentInterface
66
{
7+
/**
8+
* @return void
9+
*/
10+
public function __construct()
11+
{
12+
}
13+
714
/**
815
* No return declared here
916
*/

0 commit comments

Comments
 (0)