minor #3991 Fix some errors reported by phpstan (fabpot)

This PR was merged into the 3.x branch.

Discussion
----------

Fix some errors reported by phpstan

Commits
-------

2b2ac80d Fxi some errors reported by phpstan
This commit is contained in:
Fabien Potencier
2024-02-05 18:59:35 +01:00
22 changed files with 42 additions and 46 deletions
+2 -2
View File
@@ -396,7 +396,7 @@ final class ModuleNode extends Node
$traitable = !$this->hasNode('parent') && 0 === \count($this->getNode('macros'));
if ($traitable) {
if ($this->getNode('body') instanceof BodyNode) {
$nodes = $this->getNode('body')->getNode(0);
$nodes = $this->getNode('body')->getNode('0');
} else {
$nodes = $this->getNode('body');
}
@@ -433,7 +433,7 @@ final class ModuleNode extends Node
->write(" */\n")
->write("public function isTraitable()\n", "{\n")
->indent()
->write(sprintf("return %s;\n", $traitable ? 'true' : 'false'))
->write("return false;\n")
->outdent()
->write("}\n\n")
;