Skip to content

Commit d6967aa

Browse files
committed
Check for null value to trigger doc block generation on empty string
1 parent 41defe1 commit d6967aa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Code/MethodGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private function generateAttributes(): array
240240
return ['comments' => [new Doc($this->docBlock->generate())]];
241241
}
242242

243-
if ($this->typed === false || $this->docBlockComment || $this->returnTypeDocBlockHint) {
243+
if ($this->typed === false || $this->docBlockComment !== null || $this->returnTypeDocBlockHint !== null) {
244244
$docBlock = new DocBlock($this->docBlockComment);
245245

246246
foreach ($this->getParameters() as $parameter) {
@@ -260,10 +260,10 @@ private function generateAttributes(): array
260260
if ($this->returnType) {
261261
$returnType = $this->returnType->type();
262262
}
263-
if ($this->returnTypeDocBlockHint) {
263+
if ($this->returnTypeDocBlockHint !== null) {
264264
$returnType = $this->returnTypeDocBlockHint;
265265
}
266-
if ($returnType) {
266+
if ($returnType !== null) {
267267
$docBlock->addTag(new ReturnTag($returnType));
268268
}
269269

src/Code/PropertyGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private function generateAttributes(): array
180180
return ['comments' => [new Doc($this->docBlock->generate())]];
181181
}
182182

183-
if ($this->typed === false || $this->docBlockComment) {
183+
if ($this->typed === false || $this->docBlockComment !== null) {
184184
$docBlockType = new VarTag($this->type->types());
185185

186186
if ($typeHint = $this->getTypeDocBlockHint()) {

0 commit comments

Comments
 (0)