We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 496780a commit e972affCopy full SHA for e972aff
lib/PhpParser/Node/Stmt/ClassMethod.php
@@ -6,7 +6,7 @@
6
use PhpParser\Node;
7
use PhpParser\Node\FunctionLike;
8
9
-class ClassMethod extends Node\Stmt implements FunctionLike {
+class ClassMethod extends Node\Stmt implements FunctionLike, Node\ContainsStmts {
10
/** @var int Flags */
11
public int $flags;
12
/** @var bool Whether to return by reference */
@@ -90,7 +90,14 @@ public function getReturnType() {
90
return $this->returnType;
91
}
92
93
- public function getStmts(): ?array {
+ /**
94
+ * @return Node\Stmt[]
95
+ */
96
+ public function getStmts(): array {
97
+ if ($this->stmts === null) {
98
+ return [];
99
+ }
100
+
101
return $this->stmts;
102
103
0 commit comments