docs: fix @param array type for Commands

This commit is contained in:
kenjis 2023-10-28 11:48:52 +09:00
parent 84091575c7
commit 543c2a844c
No known key found for this signature in database
GPG Key ID: BD254878922AF198
30 changed files with 55 additions and 105 deletions

View File

@ -196,16 +196,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/CreateDatabase.php',
];
$ignoreErrors[] = [
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/CreateDatabase.php',
];
$ignoreErrors[] = [
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/CreateDatabase.php',
];
$ignoreErrors[] = [
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
'count' => 1,
@ -216,11 +206,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/MigrateStatus.php',
];
$ignoreErrors[] = [
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Database\\\\MigrateStatus\\:\\:\\$options is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$options\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/MigrateStatus.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$params \\(array\\<string, mixed\\>\\) of method CodeIgniter\\\\Commands\\\\Database\\\\MigrateStatus\\:\\:run\\(\\) should be contravariant with parameter \\$params \\(array\\<int\\|string, string\\|null\\>\\) of method CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:run\\(\\)$#',
'count' => 1,
@ -231,11 +216,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/Seed.php',
];
$ignoreErrors[] = [
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/Seed.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Commands\\\\Database\\\\ShowTableInfo\\:\\:showAllTables\\(\\) has no return type specified\\.$#',
'count' => 1,
@ -246,16 +226,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/ShowTableInfo.php',
];
$ignoreErrors[] = [
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/ShowTableInfo.php',
];
$ignoreErrors[] = [
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Database/ShowTableInfo.php',
];
$ignoreErrors[] = [
'message' => '#^Accessing offset \'encryption\\.key\' directly on \\$_SERVER is discouraged\\.$#',
'count' => 1,
@ -756,26 +726,11 @@ $ignoreErrors[] = [
'count' => 3,
'path' => __DIR__ . '/system/Commands/Utilities/Environment.php',
];
$ignoreErrors[] = [
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Utilities/Environment.php',
];
$ignoreErrors[] = [
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Utilities/FilterCheck.php',
];
$ignoreErrors[] = [
'message' => '#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Utilities/Namespaces.php',
];
$ignoreErrors[] = [
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Utilities/Publish.php',
];
$ignoreErrors[] = [
'message' => '#^Accessing offset \'HTTP_HOST\' directly on \\$_SERVER is discouraged\\.$#',
'count' => 1,
@ -796,11 +751,6 @@ $ignoreErrors[] = [
'count' => 3,
'path' => __DIR__ . '/system/Commands/Utilities/Routes.php',
];
$ignoreErrors[] = [
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Commands\\\\Utilities\\\\Routes\\:\\:\\$options is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$options\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Commands/Utilities/Routes.php',
];
$ignoreErrors[] = [
'message' => '#^Implicit array creation is not allowed \\- variable \\$filters might not exist\\.$#',
'count' => 1,

View File

@ -19,14 +19,14 @@ use Throwable;
/**
* BaseCommand is the base class used in creating CLI commands.
*
* @property array $arguments
* @property Commands $commands
* @property string $description
* @property string $group
* @property LoggerInterface $logger
* @property string $name
* @property array $options
* @property string $usage
* @property array<string, string> $arguments
* @property Commands $commands
* @property string $description
* @property string $group
* @property LoggerInterface $logger
* @property string $name
* @property array<string, string> $options
* @property string $usage
*/
abstract class BaseCommand
{
@ -62,14 +62,14 @@ abstract class BaseCommand
/**
* the Command's options description
*
* @var array
* @var array<string, string>
*/
protected $options = [];
/**
* the Command's Arguments description
*
* @var array
* @var array<string, string>
*/
protected $arguments = [];

View File

@ -52,7 +52,7 @@ class ClearCache extends BaseCommand
/**
* the Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'driver' => 'The cache driver to use',

View File

@ -53,7 +53,7 @@ class Migrate extends BaseCommand
/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'-n' => 'Set migration namespace',

View File

@ -52,7 +52,7 @@ class MigrateRefresh extends BaseCommand
/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'-n' => 'Set migration namespace',

View File

@ -54,7 +54,7 @@ class MigrateRollback extends BaseCommand
/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'-b' => 'Specify a batch to roll back to; e.g. "3" to return to batch #3',

View File

@ -52,7 +52,7 @@ class GenerateKey extends BaseCommand
/**
* The command's options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--force' => 'Force overwrite existing key in `.env` file.',

View File

@ -52,7 +52,7 @@ class CellGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The cell class name.',
@ -61,7 +61,7 @@ class CellGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',

View File

@ -53,7 +53,7 @@ class CommandGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The command class name.',
@ -62,7 +62,7 @@ class CommandGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--command' => 'The command name. Default: "command:name"',

View File

@ -52,7 +52,7 @@ class ConfigGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The config class name.',
@ -61,7 +61,7 @@ class ConfigGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',

View File

@ -56,7 +56,7 @@ class ControllerGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The controller class name.',
@ -65,7 +65,7 @@ class ControllerGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--bare' => 'Extends from CodeIgniter\Controller instead of BaseController.',

View File

@ -52,7 +52,7 @@ class EntityGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The entity class name.',
@ -61,7 +61,7 @@ class EntityGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',

View File

@ -52,7 +52,7 @@ class FilterGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The filter class name.',
@ -61,7 +61,7 @@ class FilterGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',

View File

@ -55,7 +55,7 @@ class MigrateCreate extends BaseCommand
/**
* The Command's arguments.
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The migration file name.',
@ -64,7 +64,7 @@ class MigrateCreate extends BaseCommand
/**
* The Command's options.
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--namespace' => 'Set root namespace. Defaults to APP_NAMESPACE',

View File

@ -56,7 +56,7 @@ class MigrationGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The migration class name.',
@ -65,7 +65,7 @@ class MigrationGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--session' => 'Generates the migration file for database sessions.',

View File

@ -53,7 +53,7 @@ class ModelGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The model class name.',
@ -62,7 +62,7 @@ class ModelGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--table' => 'Supply a table name. Default: "the lowercased plural of the class name".',

View File

@ -53,7 +53,7 @@ class ScaffoldGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The class name',
@ -62,7 +62,7 @@ class ScaffoldGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--bare' => 'Add the "--bare" option to controller component.',

View File

@ -52,7 +52,7 @@ class SeederGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The seeder class name.',
@ -61,7 +61,7 @@ class SeederGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',

View File

@ -59,7 +59,7 @@ class SessionMigrationGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'-t' => 'Supply a table name.',

View File

@ -52,7 +52,7 @@ class ValidationGenerator extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'The validation class name.',
@ -61,7 +61,7 @@ class ValidationGenerator extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',

View File

@ -53,7 +53,7 @@ class Help extends BaseCommand
/**
* the Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'command_name' => 'The command name [default: "help"]',
@ -62,7 +62,7 @@ class Help extends BaseCommand
/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [];

View File

@ -51,7 +51,7 @@ class ClearLogs extends BaseCommand
/**
* The Command's options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--force' => 'Force delete of all logs files without prompting.',

View File

@ -54,14 +54,14 @@ class ListCommands extends BaseCommand
/**
* the Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [];
/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--simple' => 'Prints a list of the commands with no other info',

View File

@ -54,7 +54,7 @@ class Serve extends BaseCommand
/**
* Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [];
@ -75,7 +75,7 @@ class Serve extends BaseCommand
/**
* Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'--php' => 'The PHP Binary [default: "PHP_BINARY"]',

View File

@ -62,7 +62,7 @@ final class Environment extends BaseCommand
/**
* The Command's options
*
* @var array
* @var array<string, string>
*/
protected $options = [];

View File

@ -63,7 +63,7 @@ class FilterCheck extends BaseCommand
/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [];

View File

@ -57,14 +57,14 @@ class Namespaces extends BaseCommand
/**
* the Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [];
/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'-c' => 'Show only CodeIgniter config namespaces.',

View File

@ -63,7 +63,7 @@ class Publish extends BaseCommand
/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [];

View File

@ -61,7 +61,7 @@ class Routes extends BaseCommand
/**
* the Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [];

View File

@ -49,7 +49,7 @@ class Unsuffixable extends BaseCommand
/**
* The Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'name' => 'Class name',
@ -58,7 +58,7 @@ class Unsuffixable extends BaseCommand
/**
* The Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [];