Skip to content

Commit 0f77efe

Browse files
committed
docs: fix @param array type for Commands
1 parent 8409157 commit 0f77efe

30 files changed

+56
-86
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,6 @@
196196
'count' => 1,
197197
'path' => __DIR__ . '/system/Commands/Database/CreateDatabase.php',
198198
];
199-
$ignoreErrors[] = [
200-
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Database\\\\CreateDatabase\\:\\:\\$arguments is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$arguments\\.$#',
201-
'count' => 1,
202-
'path' => __DIR__ . '/system/Commands/Database/CreateDatabase.php',
203-
];
204199
$ignoreErrors[] = [
205200
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Database\\\\CreateDatabase\\:\\:\\$options is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$options\\.$#',
206201
'count' => 1,
@@ -231,11 +226,6 @@
231226
'count' => 1,
232227
'path' => __DIR__ . '/system/Commands/Database/Seed.php',
233228
];
234-
$ignoreErrors[] = [
235-
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Database\\\\Seed\\:\\:\\$arguments is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$arguments\\.$#',
236-
'count' => 1,
237-
'path' => __DIR__ . '/system/Commands/Database/Seed.php',
238-
];
239229
$ignoreErrors[] = [
240230
'message' => '#^Method CodeIgniter\\\\Commands\\\\Database\\\\ShowTableInfo\\:\\:showAllTables\\(\\) has no return type specified\\.$#',
241231
'count' => 1,
@@ -246,11 +236,6 @@
246236
'count' => 1,
247237
'path' => __DIR__ . '/system/Commands/Database/ShowTableInfo.php',
248238
];
249-
$ignoreErrors[] = [
250-
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Database\\\\ShowTableInfo\\:\\:\\$arguments is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$arguments\\.$#',
251-
'count' => 1,
252-
'path' => __DIR__ . '/system/Commands/Database/ShowTableInfo.php',
253-
];
254239
$ignoreErrors[] = [
255240
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Database\\\\ShowTableInfo\\:\\:\\$options is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$options\\.$#',
256241
'count' => 1,
@@ -756,26 +741,11 @@
756741
'count' => 3,
757742
'path' => __DIR__ . '/system/Commands/Utilities/Environment.php',
758743
];
759-
$ignoreErrors[] = [
760-
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Utilities\\\\Environment\\:\\:\\$arguments is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$arguments\\.$#',
761-
'count' => 1,
762-
'path' => __DIR__ . '/system/Commands/Utilities/Environment.php',
763-
];
764-
$ignoreErrors[] = [
765-
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Utilities\\\\FilterCheck\\:\\:\\$arguments is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$arguments\\.$#',
766-
'count' => 1,
767-
'path' => __DIR__ . '/system/Commands/Utilities/FilterCheck.php',
768-
];
769744
$ignoreErrors[] = [
770745
'message' => '#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#',
771746
'count' => 1,
772747
'path' => __DIR__ . '/system/Commands/Utilities/Namespaces.php',
773748
];
774-
$ignoreErrors[] = [
775-
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Utilities\\\\Publish\\:\\:\\$arguments is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$arguments\\.$#',
776-
'count' => 1,
777-
'path' => __DIR__ . '/system/Commands/Utilities/Publish.php',
778-
];
779749
$ignoreErrors[] = [
780750
'message' => '#^Accessing offset \'HTTP_HOST\' directly on \\$_SERVER is discouraged\\.$#',
781751
'count' => 1,

system/CLI/BaseCommand.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
/**
2020
* BaseCommand is the base class used in creating CLI commands.
2121
*
22-
* @property array $arguments
23-
* @property Commands $commands
24-
* @property string $description
25-
* @property string $group
26-
* @property LoggerInterface $logger
27-
* @property string $name
28-
* @property array $options
29-
* @property string $usage
22+
* @property array<string, string> $arguments
23+
* @property Commands $commands
24+
* @property string $description
25+
* @property string $group
26+
* @property LoggerInterface $logger
27+
* @property string $name
28+
* @property array<string, string> $options
29+
* @property string $usage
3030
*/
3131
abstract class BaseCommand
3232
{
@@ -62,14 +62,14 @@ abstract class BaseCommand
6262
/**
6363
* the Command's options description
6464
*
65-
* @var array
65+
* @var array<string, string>
6666
*/
6767
protected $options = [];
6868

6969
/**
7070
* the Command's Arguments description
7171
*
72-
* @var array
72+
* @var array<string, string>
7373
*/
7474
protected $arguments = [];
7575

system/Commands/Cache/ClearCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ClearCache extends BaseCommand
5252
/**
5353
* the Command's Arguments
5454
*
55-
* @var array
55+
* @var array<string, string>
5656
*/
5757
protected $arguments = [
5858
'driver' => 'The cache driver to use',

system/Commands/Database/Migrate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Migrate extends BaseCommand
5353
/**
5454
* the Command's Options
5555
*
56-
* @var array
56+
* @var array<string, string>
5757
*/
5858
protected $options = [
5959
'-n' => 'Set migration namespace',

system/Commands/Database/MigrateRefresh.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class MigrateRefresh extends BaseCommand
5252
/**
5353
* the Command's Options
5454
*
55-
* @var array
55+
* @var array<string, string>
5656
*/
5757
protected $options = [
5858
'-n' => 'Set migration namespace',

system/Commands/Database/MigrateRollback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class MigrateRollback extends BaseCommand
5454
/**
5555
* the Command's Options
5656
*
57-
* @var array
57+
* @var array<string, string>
5858
*/
5959
protected $options = [
6060
'-b' => 'Specify a batch to roll back to; e.g. "3" to return to batch #3',

system/Commands/Encryption/GenerateKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class GenerateKey extends BaseCommand
5252
/**
5353
* The command's options
5454
*
55-
* @var array
55+
* @var array<string, string>
5656
*/
5757
protected $options = [
5858
'--force' => 'Force overwrite existing key in `.env` file.',

system/Commands/Generators/CellGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CellGenerator extends BaseCommand
5252
/**
5353
* The Command's Arguments
5454
*
55-
* @var array
55+
* @var array<string, string>
5656
*/
5757
protected $arguments = [
5858
'name' => 'The cell class name.',
@@ -61,7 +61,7 @@ class CellGenerator extends BaseCommand
6161
/**
6262
* The Command's Options
6363
*
64-
* @var array
64+
* @var array<string, string>
6565
*/
6666
protected $options = [
6767
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',

system/Commands/Generators/CommandGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CommandGenerator extends BaseCommand
5353
/**
5454
* The Command's Arguments
5555
*
56-
* @var array
56+
* @var array<string, string>
5757
*/
5858
protected $arguments = [
5959
'name' => 'The command class name.',
@@ -62,7 +62,7 @@ class CommandGenerator extends BaseCommand
6262
/**
6363
* The Command's Options
6464
*
65-
* @var array
65+
* @var array<string, string>
6666
*/
6767
protected $options = [
6868
'--command' => 'The command name. Default: "command:name"',

system/Commands/Generators/ConfigGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ConfigGenerator extends BaseCommand
5252
/**
5353
* The Command's Arguments
5454
*
55-
* @var array
55+
* @var array<string, string>
5656
*/
5757
protected $arguments = [
5858
'name' => 'The config class name.',
@@ -61,7 +61,7 @@ class ConfigGenerator extends BaseCommand
6161
/**
6262
* The Command's Options
6363
*
64-
* @var array
64+
* @var array<string, string>
6565
*/
6666
protected $options = [
6767
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',

0 commit comments

Comments
 (0)