Skip to content

Commit 9b4a591

Browse files
committed
Fix BC break in PHPStan\Node\ClassMethod
See d0a9d08#r75178623
1 parent 6ee8810 commit 9b4a591

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/Node/ClassMethod.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,29 @@
22

33
namespace PHPStan\Node;
44

5-
class ClassMethod
5+
use PhpParser\Node\Stmt\ClassMethod as PhpParserClassMethod;
6+
7+
class ClassMethod extends PhpParserClassMethod
68
{
79

810
public function __construct(
9-
private \PhpParser\Node\Stmt\ClassMethod $node,
11+
\PhpParser\Node\Stmt\ClassMethod $node,
1012
private bool $isDeclaredInTrait,
1113
)
1214
{
15+
parent::__construct($node->name, [
16+
'flags' => $node->flags,
17+
'byRef' => $node->byRef,
18+
'params' => $node->params,
19+
'returnType' => $node->returnType,
20+
'stmts' => $node->stmts,
21+
'attrGroups' => $node->attrGroups,
22+
], $node->attributes);
1323
}
1424

15-
public function getNode(): \PhpParser\Node\Stmt\ClassMethod
25+
public function getNode(): PhpParserClassMethod
1626
{
17-
return $this->node;
27+
return $this;
1828
}
1929

2030
public function isDeclaredInTrait(): bool

0 commit comments

Comments
 (0)