Skip to content

Commit 5fd39fb

Browse files
committed
type fixes
1 parent 43ce996 commit 5fd39fb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ final class ClassType
5050
/** @var string[] */
5151
private $implements = [];
5252

53-
/** @var string[] */
53+
/** @var array[] */
5454
private $traits = [];
5555

5656
/** @var Constant[] name => Constant */
@@ -422,7 +422,7 @@ public function addMethod(string $name): Method
422422
}
423423

424424

425-
private function validate(array $names)
425+
private function validate(array $names): void
426426
{
427427
foreach ($names as $name) {
428428
if (!Helpers::isNamespaceIdentifier($name, true)) {

src/PhpGenerator/Method.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function __toString(): string
7979
*/
8080
public function setBody(?string $code, array $args = null): self
8181
{
82-
$this->body = $args === null ? $code : Helpers::formatArgs($code, $args);
82+
$this->body = $args === null || $code === null ? $code : Helpers::formatArgs($code, $args);
8383
return $this;
8484
}
8585

0 commit comments

Comments
 (0)