Skip to content

Commit

Permalink
Change default value to an empty string instead of null
Browse files Browse the repository at this point in the history
  • Loading branch information
freost committed Oct 23, 2024
1 parent 15549ff commit 715ba20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mako/reactor/Reactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected function getCommandDescription(ReflectionClass $class): string
return $command->getDescription();
}

return (string) $attributes[0]->newInstance()->getDescription();
return $attributes[0]->newInstance()->getDescription();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/mako/reactor/attributes/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Command
*/
public function __construct(
protected string $name,
protected ?string $description = null,
protected string $description = '',
) {
}

Expand All @@ -35,7 +35,7 @@ public function getName(): string
/**
* Returns the command description.
*/
public function getDescription(): ?string
public function getDescription(): string
{
return $this->description;
}
Expand Down

0 comments on commit 715ba20

Please sign in to comment.