diff --git a/phpstan-baseline.php b/phpstan-baseline.php index 9c5c98a51e45..1bec8d83965b 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -261,26 +261,6 @@ 'count' => 1, 'path' => __DIR__ . '/system/BaseModel.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/system/CLI/BaseCommand.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:__get\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CLI/BaseCommand.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:call\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CLI/BaseCommand.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:getPad\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CLI/BaseCommand.php', -]; $ignoreErrors[] = [ 'message' => '#^Accessing offset \'ANSICON\' directly on \\$_SERVER is discouraged\\.$#', 'count' => 1, diff --git a/system/CLI/BaseCommand.php b/system/CLI/BaseCommand.php index 1b273846bd74..86ba504feaa6 100644 --- a/system/CLI/BaseCommand.php +++ b/system/CLI/BaseCommand.php @@ -108,6 +108,8 @@ abstract public function run(array $params); /** * Can be used by a command to run other commands. * + * @param array $params + * * @return int|void * * @throws ReflectionException @@ -140,7 +142,7 @@ public function showHelp() { CLI::write(lang('CLI.helpUsage'), 'yellow'); - if (! empty($this->usage)) { + if (isset($this->usage)) { $usage = $this->usage; } else { $usage = $this->name; @@ -152,7 +154,7 @@ public function showHelp() CLI::write($this->setPad($usage, 0, 0, 2)); - if (! empty($this->description)) { + if (isset($this->description)) { CLI::newLine(); CLI::write(lang('CLI.helpDescription'), 'yellow'); CLI::write($this->setPad($this->description, 0, 0, 2)); @@ -194,6 +196,8 @@ public function setPad(string $item, int $max, int $extra = 2, int $indent = 0): /** * Get pad for $key => $value array output * + * @param array $array + * * @deprecated Use setPad() instead. * * @codeCoverageIgnore @@ -212,7 +216,7 @@ public function getPad(array $array, int $pad): int /** * Makes it simple to access our protected properties. * - * @return array|Commands|LoggerInterface|string|null + * @return array|Commands|LoggerInterface|string|null */ public function __get(string $key) {