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".',

system/Commands/Generators/ControllerGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ControllerGenerator extends BaseCommand
5656
/**
5757
* The Command's Arguments
5858
*
59-
* @var array
59+
* @var array<string, string>
6060
*/
6161
protected $arguments = [
6262
'name' => 'The controller class name.',
@@ -65,7 +65,7 @@ class ControllerGenerator extends BaseCommand
6565
/**
6666
* The Command's Options
6767
*
68-
* @var array
68+
* @var array<string, string>
6969
*/
7070
protected $options = [
7171
'--bare' => 'Extends from CodeIgniter\Controller instead of BaseController.',

system/Commands/Generators/EntityGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class EntityGenerator extends BaseCommand
5252
/**
5353
* The Command's Arguments
5454
*
55-
* @var array
55+
* @var array<string, string>
5656
*/
5757
protected $arguments = [
5858
'name' => 'The entity class name.',
@@ -61,7 +61,7 @@ class EntityGenerator 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/FilterGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class FilterGenerator extends BaseCommand
5252
/**
5353
* The Command's Arguments
5454
*
55-
* @var array
55+
* @var array<string, string>
5656
*/
5757
protected $arguments = [
5858
'name' => 'The filter class name.',
@@ -61,7 +61,7 @@ class FilterGenerator 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/MigrateCreate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class MigrateCreate extends BaseCommand
5555
/**
5656
* The Command's arguments.
5757
*
58-
* @var array
58+
* @var array<string, string>
5959
*/
6060
protected $arguments = [
6161
'name' => 'The migration file name.',
@@ -64,7 +64,7 @@ class MigrateCreate extends BaseCommand
6464
/**
6565
* The Command's options.
6666
*
67-
* @var array
67+
* @var array<string, string>
6868
*/
6969
protected $options = [
7070
'--namespace' => 'Set root namespace. Defaults to APP_NAMESPACE',

system/Commands/Generators/MigrationGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class MigrationGenerator extends BaseCommand
5656
/**
5757
* The Command's Arguments
5858
*
59-
* @var array
59+
* @var array<string, string>
6060
*/
6161
protected $arguments = [
6262
'name' => 'The migration class name.',
@@ -65,7 +65,7 @@ class MigrationGenerator extends BaseCommand
6565
/**
6666
* The Command's Options
6767
*
68-
* @var array
68+
* @var array<string, string>
6969
*/
7070
protected $options = [
7171
'--session' => 'Generates the migration file for database sessions.',

system/Commands/Generators/ModelGenerator.php

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

system/Commands/Generators/ScaffoldGenerator.php

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

system/Commands/Generators/SeederGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class SeederGenerator extends BaseCommand
5252
/**
5353
* The Command's Arguments
5454
*
55-
* @var array
55+
* @var array<string, string>
5656
*/
5757
protected $arguments = [
5858
'name' => 'The seeder class name.',
@@ -61,7 +61,7 @@ class SeederGenerator 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/SessionMigrationGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class SessionMigrationGenerator extends BaseCommand
5959
/**
6060
* The Command's Options
6161
*
62-
* @var array
62+
* @var array<string, string>
6363
*/
6464
protected $options = [
6565
'-t' => 'Supply a table name.',

system/Commands/Generators/ValidationGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ValidationGenerator extends BaseCommand
5252
/**
5353
* The Command's Arguments
5454
*
55-
* @var array
55+
* @var array<string, string>
5656
*/
5757
protected $arguments = [
5858
'name' => 'The validation class name.',
@@ -61,7 +61,7 @@ class ValidationGenerator 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/Help.php

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

system/Commands/Housekeeping/ClearLogs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ClearLogs extends BaseCommand
5151
/**
5252
* The Command's options
5353
*
54-
* @var array
54+
* @var array<string, string>
5555
*/
5656
protected $options = [
5757
'--force' => 'Force delete of all logs files without prompting.',

0 commit comments

Comments
 (0)