diff --git a/src/Command/Activity/ActivityListCommand.php b/src/Command/Activity/ActivityListCommand.php index 247dc3161..400400fd1 100644 --- a/src/Command/Activity/ActivityListCommand.php +++ b/src/Command/Activity/ActivityListCommand.php @@ -19,6 +19,7 @@ #[AsCommand(name: 'activity:list', description: 'Get a list of activities for an environment or project', aliases: ['activities', 'act'])] class ActivityListCommand extends ActivityCommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'ID', 'created' => 'Created', @@ -35,6 +36,7 @@ class ActivityListCommand extends ActivityCommandBase 'time_deploy' => 'Deploy time (s)', ]; + /** @var string[] */ private array $defaultColumns = ['id', 'created', 'description', 'progress', 'state', 'result']; public function __construct(private readonly ActivityLoader $activityLoader, private readonly Api $api, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) diff --git a/src/Command/App/AppListCommand.php b/src/Command/App/AppListCommand.php index 627462fa2..cfc18c6e0 100644 --- a/src/Command/App/AppListCommand.php +++ b/src/Command/App/AppListCommand.php @@ -18,8 +18,11 @@ #[AsCommand(name: 'app:list', description: 'List apps in the project', aliases: ['apps'])] class AppListCommand extends CommandBase { + /** @var array */ private array $tableHeader = ['Name', 'Type', 'disk' => 'Disk', 'Size', 'path' => 'Path']; + /** @var string[] */ private array $defaultColumns = ['name', 'type']; + public function __construct(private readonly Api $api, private readonly ApplicationFinder $applicationFinder, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { parent::__construct(); diff --git a/src/Command/Backup/BackupListCommand.php b/src/Command/Backup/BackupListCommand.php index d57043dd8..f34713dcc 100644 --- a/src/Command/Backup/BackupListCommand.php +++ b/src/Command/Backup/BackupListCommand.php @@ -17,6 +17,7 @@ class BackupListCommand extends CommandBase { + /** @var array */ private array $tableHeader = [ 'created_at' => 'Created', 'id' => 'Backup ID', @@ -29,6 +30,7 @@ class BackupListCommand extends CommandBase 'status' => 'Status', 'updated_at' => 'Updated', ]; + /** @var string[] */ private array $defaultColumns = ['created_at', 'id', 'restorable']; public function __construct(private readonly Api $api, private readonly Io $io, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Certificate/CertificateListCommand.php b/src/Command/Certificate/CertificateListCommand.php index 92d508203..aa936911c 100644 --- a/src/Command/Certificate/CertificateListCommand.php +++ b/src/Command/Certificate/CertificateListCommand.php @@ -16,6 +16,7 @@ #[AsCommand(name: 'certificate:list', description: 'List project certificates', aliases: ['certificates', 'certs'])] class CertificateListCommand extends CommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'ID', 'domains' => 'Domain(s)', diff --git a/src/Command/Commit/CommitListCommand.php b/src/Command/Commit/CommitListCommand.php index b5576a517..c7a31b162 100644 --- a/src/Command/Commit/CommitListCommand.php +++ b/src/Command/Commit/CommitListCommand.php @@ -22,8 +22,9 @@ #[AsCommand(name: 'commit:list', description: 'List commits', aliases: ['commits'])] class CommitListCommand extends CommandBase { - + /** @var array */ private array $tableHeader = ['Date', 'SHA', 'Author', 'Summary']; + public function __construct(private readonly Api $api, private readonly GitDataApi $gitDataApi, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { parent::__construct(); diff --git a/src/Command/Db/DbSizeCommand.php b/src/Command/Db/DbSizeCommand.php index 29b97c639..84c887a68 100644 --- a/src/Command/Db/DbSizeCommand.php +++ b/src/Command/Db/DbSizeCommand.php @@ -26,6 +26,7 @@ class DbSizeCommand extends CommandBase { + /** @var array */ private array $tableHeader = ['max' => 'Allocated disk', 'used' => 'Estimated usage', 'percent_used' => '% used']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly Io $io, private readonly QuestionHelper $questionHelper, private readonly Relationships $relationships, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Domain/DomainListCommand.php b/src/Command/Domain/DomainListCommand.php index c0b0cca27..6d4e2ec0a 100644 --- a/src/Command/Domain/DomainListCommand.php +++ b/src/Command/Domain/DomainListCommand.php @@ -18,6 +18,7 @@ #[AsCommand(name: 'domain:list', description: 'Get a list of all domains', aliases: ['domains'])] class DomainListCommand extends DomainCommandBase { + /** @var array */ private array $tableHeader = [ 'name' => 'Name', 'ssl' => 'SSL enabled', @@ -27,6 +28,7 @@ class DomainListCommand extends DomainCommandBase 'replacement_for' => 'Attached domain', 'type' => 'Type', ]; + /** @var string[] */ private array $defaultColumns = ['name', 'ssl', 'created_at']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Environment/EnvironmentListCommand.php b/src/Command/Environment/EnvironmentListCommand.php index b51ff3d6b..b4db762a8 100644 --- a/src/Command/Environment/EnvironmentListCommand.php +++ b/src/Command/Environment/EnvironmentListCommand.php @@ -20,7 +20,9 @@ #[AsCommand(name: 'environment:list', description: 'Get a list of environments', aliases: ['environments', 'env'])] class EnvironmentListCommand extends CommandBase { + /** @var array */ private array $tableHeader = ['ID', 'machine_name' => 'Machine name', 'Title', 'Status', 'Type', 'Created', 'Updated']; + /** @var string[] */ private array $defaultColumns = ['id', 'title', 'status', 'type']; private Environment|false $currentEnvironment = false; diff --git a/src/Command/Integration/Activity/IntegrationActivityListCommand.php b/src/Command/Integration/Activity/IntegrationActivityListCommand.php index 622ced244..042c65e41 100644 --- a/src/Command/Integration/Activity/IntegrationActivityListCommand.php +++ b/src/Command/Integration/Activity/IntegrationActivityListCommand.php @@ -23,6 +23,7 @@ #[AsCommand(name: 'integration:activity:list', description: 'Get a list of activities for an integration', aliases: ['integration:activities'])] class IntegrationActivityListCommand extends IntegrationCommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'ID', 'created' => 'Created', @@ -37,6 +38,7 @@ class IntegrationActivityListCommand extends IntegrationCommandBase 'time_build' => 'Build time (s)', 'time_deploy' => 'Deploy time (s)', ]; + /** @var string[] */ private array $defaultColumns = ['id', 'created', 'description', 'type', 'state', 'result']; public function __construct(private readonly ActivityLoader $activityLoader, private readonly Api $api, private readonly Config $config, private readonly Io $io, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Integration/IntegrationListCommand.php b/src/Command/Integration/IntegrationListCommand.php index ea5dd491b..2d85dc472 100644 --- a/src/Command/Integration/IntegrationListCommand.php +++ b/src/Command/Integration/IntegrationListCommand.php @@ -14,6 +14,7 @@ #[AsCommand(name: 'integration:list', description: 'View a list of project integration(s)', aliases: ['integrations'])] class IntegrationListCommand extends IntegrationCommandBase { + /** @var array */ private array $tableHeader = ['ID', 'Type', 'Summary']; public function __construct(private readonly Config $config, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Metrics/AllMetricsCommand.php b/src/Command/Metrics/AllMetricsCommand.php index 7cebe8676..6b6562ac1 100644 --- a/src/Command/Metrics/AllMetricsCommand.php +++ b/src/Command/Metrics/AllMetricsCommand.php @@ -15,6 +15,7 @@ #[AsCommand(name: 'metrics:all', description: 'Show CPU, disk and memory metrics for an environment', aliases: ['metrics', 'met'])] class AllMetricsCommand extends MetricsCommandBase { + /** @var array */ private array $tableHeader = [ 'timestamp' => 'Timestamp', 'service' => 'Service', @@ -45,6 +46,7 @@ class AllMetricsCommand extends MetricsCommandBase 'tmp_inodes_percent' => '/tmp inodes %', ]; + /** @var string[] */ private array $defaultColumns = ['timestamp', 'service', 'cpu_percent', 'mem_percent', 'disk_percent', 'tmp_disk_percent']; public function __construct(private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Metrics/CpuCommand.php b/src/Command/Metrics/CpuCommand.php index 9012c0711..677e7f7b0 100644 --- a/src/Command/Metrics/CpuCommand.php +++ b/src/Command/Metrics/CpuCommand.php @@ -14,6 +14,7 @@ #[AsCommand(name: 'metrics:cpu', description: 'Show CPU usage of an environment', aliases: ['cpu'])] class CpuCommand extends MetricsCommandBase { + /** @var array */ private array $tableHeader = [ 'timestamp' => 'Timestamp', 'service' => 'Service', @@ -23,6 +24,7 @@ class CpuCommand extends MetricsCommandBase 'percent' => 'Used %', ]; + /** @var string[] */ private array $defaultColumns = ['timestamp', 'service', 'used', 'limit', 'percent']; public function __construct(private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Metrics/DiskUsageCommand.php b/src/Command/Metrics/DiskUsageCommand.php index 1ff697b6b..9081a38b6 100644 --- a/src/Command/Metrics/DiskUsageCommand.php +++ b/src/Command/Metrics/DiskUsageCommand.php @@ -15,6 +15,7 @@ #[AsCommand(name: 'metrics:disk-usage', description: 'Show disk usage of an environment', aliases: ['disk'])] class DiskUsageCommand extends MetricsCommandBase { + /** @var array */ private array $tableHeader = [ 'timestamp' => 'Timestamp', 'service' => 'Service', @@ -32,6 +33,7 @@ class DiskUsageCommand extends MetricsCommandBase 'tmp_ilimit' => '/tmp inodes limit', 'tmp_ipercent' => '/tmp inodes %', ]; + /** @var string[] */ private array $defaultColumns = ['timestamp', 'service', 'used', 'limit', 'percent', 'ipercent', 'tmp_percent']; private array $tmpReportColumns = ['timestamp', 'service', 'tmp_used', 'tmp_limit', 'tmp_percent', 'tmp_ipercent']; public function __construct(private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) diff --git a/src/Command/Metrics/MemCommand.php b/src/Command/Metrics/MemCommand.php index 3d939beeb..0267ec262 100644 --- a/src/Command/Metrics/MemCommand.php +++ b/src/Command/Metrics/MemCommand.php @@ -15,6 +15,7 @@ #[AsCommand(name: 'metrics:memory', description: 'Show memory usage of an environment', aliases: ['mem', 'memory'])] class MemCommand extends MetricsCommandBase { + /** @var array */ private array $tableHeader = [ 'timestamp' => 'Timestamp', 'service' => 'Service', @@ -24,6 +25,7 @@ class MemCommand extends MetricsCommandBase 'percent' => 'Used %', ]; + /** @var string[] */ private array $defaultColumns = ['timestamp', 'service', 'used', 'limit', 'percent']; public function __construct(private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Mount/MountListCommand.php b/src/Command/Mount/MountListCommand.php index 247b9c86f..dd0ff35be 100644 --- a/src/Command/Mount/MountListCommand.php +++ b/src/Command/Mount/MountListCommand.php @@ -23,6 +23,7 @@ #[AsCommand(name: 'mount:list', description: 'Get a list of mounts', aliases: ['mounts'])] class MountListCommand extends CommandBase { + /** @var array */ private array $tableHeader = ['path' => 'Mount path', 'definition' => 'Definition']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly Io $io, private readonly Mount $mount, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Mount/MountSizeCommand.php b/src/Command/Mount/MountSizeCommand.php index f80866260..a316a3faa 100644 --- a/src/Command/Mount/MountSizeCommand.php +++ b/src/Command/Mount/MountSizeCommand.php @@ -22,6 +22,7 @@ #[AsCommand(name: 'mount:size', description: 'Check the disk usage of mounts')] class MountSizeCommand extends CommandBase { + /** @var array */ private array $tableHeader = [ 'mounts' => 'Mount(s)', 'sizes' => 'Size(s)', diff --git a/src/Command/Organization/OrganizationListCommand.php b/src/Command/Organization/OrganizationListCommand.php index 981100b84..81640a065 100644 --- a/src/Command/Organization/OrganizationListCommand.php +++ b/src/Command/Organization/OrganizationListCommand.php @@ -13,6 +13,7 @@ #[AsCommand(name: 'organization:list', description: 'List organizations', aliases: ['orgs', 'organizations'])] class OrganizationListCommand extends OrganizationCommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'ID', 'name' => 'Name', @@ -23,6 +24,7 @@ class OrganizationListCommand extends OrganizationCommandBase 'owner_email' => 'Owner email', 'owner_username' => 'Owner username', ]; + /** @var string[] */ private array $defaultColumns = ['name', 'label', 'owner_email']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Organization/OrganizationSubscriptionListCommand.php b/src/Command/Organization/OrganizationSubscriptionListCommand.php index 734d80b8f..1baec0986 100644 --- a/src/Command/Organization/OrganizationSubscriptionListCommand.php +++ b/src/Command/Organization/OrganizationSubscriptionListCommand.php @@ -15,6 +15,7 @@ #[AsCommand(name: 'organization:subscription:list', description: 'List subscriptions within an organization', aliases: ['org:subs'])] class OrganizationSubscriptionListCommand extends OrganizationCommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'Subscription ID', 'project_id' => 'Project ID', @@ -24,6 +25,7 @@ class OrganizationSubscriptionListCommand extends OrganizationCommandBase 'updated_at' => 'Updated at', ]; + /** @var string[] */ private array $defaultColumns = ['id', 'project_id', 'project_title', 'project_region']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly Selector $selector, private readonly Table $table) diff --git a/src/Command/Organization/User/OrganizationUserListCommand.php b/src/Command/Organization/User/OrganizationUserListCommand.php index 6633474dd..05c6a8dc5 100644 --- a/src/Command/Organization/User/OrganizationUserListCommand.php +++ b/src/Command/Organization/User/OrganizationUserListCommand.php @@ -18,6 +18,7 @@ #[AsCommand(name: 'organization:user:list', description: 'List organization users', aliases: ['org:users'])] class OrganizationUserListCommand extends OrganizationCommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'ID', 'first_name' => 'First name', @@ -31,6 +32,7 @@ class OrganizationUserListCommand extends OrganizationCommandBase 'created_at' => 'Created at', 'updated_at' => 'Updated at', ]; + /** @var string[] */ private array $defaultColumns = ['id', 'email', 'owner', 'permissions']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) diff --git a/src/Command/Organization/User/OrganizationUserProjectsCommand.php b/src/Command/Organization/User/OrganizationUserProjectsCommand.php index cd32fb970..f26df066a 100644 --- a/src/Command/Organization/User/OrganizationUserProjectsCommand.php +++ b/src/Command/Organization/User/OrganizationUserProjectsCommand.php @@ -23,6 +23,7 @@ #[AsCommand(name: 'organization:user:projects', description: 'List the projects a user can access', aliases: ['oups'])] class OrganizationUserProjectsCommand extends OrganizationCommandBase { + /** @var array */ protected array $tableHeader = [ 'organization_id' => 'Organization ID', 'organization_name' => 'Organization', @@ -35,6 +36,7 @@ class OrganizationUserProjectsCommand extends OrganizationCommandBase 'region' => 'Region', ]; + /** @var string[] */ protected array $defaultColumns = ['project_id', 'project_title', 'roles', 'updated_at']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly Io $io, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) diff --git a/src/Command/Project/ProjectListCommand.php b/src/Command/Project/ProjectListCommand.php index 57d3f991f..3d1596014 100644 --- a/src/Command/Project/ProjectListCommand.php +++ b/src/Command/Project/ProjectListCommand.php @@ -21,6 +21,7 @@ #[AsCommand(name: 'project:list', description: 'Get a list of all active projects', aliases: ['projects', 'pro'])] class ProjectListCommand extends CommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'ID', 'title' => 'Title', @@ -31,6 +32,7 @@ class ProjectListCommand extends CommandBase 'status' => 'Status', 'created_at' => 'Created', ]; + /** @var string[] */ private array $defaultColumns = ['id', 'title', 'region']; public function __construct( diff --git a/src/Command/Resources/Build/BuildResourcesGetCommand.php b/src/Command/Resources/Build/BuildResourcesGetCommand.php index 20b098420..40ae3cf19 100644 --- a/src/Command/Resources/Build/BuildResourcesGetCommand.php +++ b/src/Command/Resources/Build/BuildResourcesGetCommand.php @@ -15,6 +15,7 @@ #[AsCommand(name: 'resources:build:get', description: 'View the build resources of a project', aliases: ['build-resources:get', 'build-resources'])] class BuildResourcesGetCommand extends CommandBase { + /** @var array */ protected array $tableHeader = [ 'cpu' => 'CPU', 'memory' => 'Memory (MB)', diff --git a/src/Command/Resources/ResourcesGetCommand.php b/src/Command/Resources/ResourcesGetCommand.php index 2674ebada..1001f7c3d 100644 --- a/src/Command/Resources/ResourcesGetCommand.php +++ b/src/Command/Resources/ResourcesGetCommand.php @@ -18,6 +18,7 @@ #[AsCommand(name: 'resources:get', description: 'View the resources of apps and services on an environment', aliases: ['resources', 'res'])] class ResourcesGetCommand extends ResourcesCommandBase { + /** @var array */ protected array $tableHeader = [ 'service' => 'App or service', 'type' => 'Type', @@ -30,6 +31,7 @@ class ResourcesGetCommand extends ResourcesCommandBase 'base_memory' => 'Base memory', 'memory_ratio' => 'Memory ratio', ]; + /** @var string[] */ protected array $defaultColumns = ['service', 'profile_size', 'cpu', 'memory', 'disk', 'instance_count']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly ResourcesUtil $resourcesUtil, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Resources/ResourcesSizeListCommand.php b/src/Command/Resources/ResourcesSizeListCommand.php index 0c6eb32e2..11af222c3 100644 --- a/src/Command/Resources/ResourcesSizeListCommand.php +++ b/src/Command/Resources/ResourcesSizeListCommand.php @@ -16,6 +16,7 @@ #[AsCommand(name: 'resources:size:list', description: 'List container profile sizes', aliases: ['resources:sizes'])] class ResourcesSizeListCommand extends ResourcesCommandBase { + /** @var array */ protected array $tableHeader = ['size' => 'Size name', 'cpu' => 'CPU', 'memory' => 'Memory (MB)']; public function __construct(private readonly Api $api, private readonly QuestionHelper $questionHelper, private readonly ResourcesUtil $resourcesUtil, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Route/RouteListCommand.php b/src/Command/Route/RouteListCommand.php index 7bf397434..5a0825db7 100644 --- a/src/Command/Route/RouteListCommand.php +++ b/src/Command/Route/RouteListCommand.php @@ -19,12 +19,14 @@ #[AsCommand(name: 'route:list', description: 'List all routes for an environment', aliases: ['routes'])] class RouteListCommand extends CommandBase { + /** @var array */ private array $tableHeader = [ 'route' => 'Route', 'type' => 'Type', 'to' => 'To', 'url' => 'URL', ]; + /** @var string[] */ private array $defaultColumns = ['route', 'type', 'to']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly Io $io, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/RuntimeOperation/ListCommand.php b/src/Command/RuntimeOperation/ListCommand.php index 498fe3583..a39fe4e9b 100644 --- a/src/Command/RuntimeOperation/ListCommand.php +++ b/src/Command/RuntimeOperation/ListCommand.php @@ -24,7 +24,9 @@ class ListCommand extends CommandBase { const COMMAND_MAX_LENGTH = 24; + /** @var array */ private array $tableHeader = ['service' => 'Service', 'name' => 'Operation name', 'start' => 'Start command', 'stop' => 'Stop command', 'role' => 'Role']; + /** @var string[] */ private array $defaultColumns = ['service', 'name', 'start']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Self/SelfStatsCommand.php b/src/Command/Self/SelfStatsCommand.php index b66651131..67aeccc91 100644 --- a/src/Command/Self/SelfStatsCommand.php +++ b/src/Command/Self/SelfStatsCommand.php @@ -17,7 +17,9 @@ class SelfStatsCommand extends CommandBase { protected bool $hiddenInList = true; + /** @var array */ private array $tableHeader = ['Release', 'Date', 'Asset', 'Downloads']; + public function __construct(private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Table $table) { parent::__construct(); diff --git a/src/Command/Service/ServiceListCommand.php b/src/Command/Service/ServiceListCommand.php index ddbca1898..eecabcb2a 100644 --- a/src/Command/Service/ServiceListCommand.php +++ b/src/Command/Service/ServiceListCommand.php @@ -16,7 +16,9 @@ #[AsCommand(name: 'service:list', description: 'List services in the project', aliases: ['services'])] class ServiceListCommand extends CommandBase { + /** @var array */ private array $tableHeader = ['Name', 'Type', 'disk' => 'Disk (MiB)', 'Size']; + public function __construct(private readonly Api $api, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { parent::__construct(); diff --git a/src/Command/SourceOperation/ListCommand.php b/src/Command/SourceOperation/ListCommand.php index 78b3cb506..2300c8d68 100644 --- a/src/Command/SourceOperation/ListCommand.php +++ b/src/Command/SourceOperation/ListCommand.php @@ -20,7 +20,9 @@ class ListCommand extends CommandBase { const COMMAND_MAX_LENGTH = 24; + /** @var array */ private array $tableHeader = ['Operation', 'App', 'Command']; + public function __construct(private readonly Api $api, private readonly Config $config, private readonly Selector $selector, private readonly Table $table) { parent::__construct(); diff --git a/src/Command/SshKey/SshKeyListCommand.php b/src/Command/SshKey/SshKeyListCommand.php index ab1e7a7dd..39c407c53 100644 --- a/src/Command/SshKey/SshKeyListCommand.php +++ b/src/Command/SshKey/SshKeyListCommand.php @@ -12,12 +12,14 @@ #[AsCommand(name: 'ssh-key:list', description: 'Get a list of SSH keys in your account', aliases: ['ssh-keys'])] class SshKeyListCommand extends SshKeyCommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'ID', 'title' => 'Title', 'fingerprint' => 'Fingerprint', 'path' => 'Local path' ]; + /** @var string[] */ private array $defaultColumns = ['id', 'title', 'path']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly SshKey $sshKey, private readonly Table $table) { diff --git a/src/Command/Team/Project/TeamProjectListCommand.php b/src/Command/Team/Project/TeamProjectListCommand.php index 23754cc6e..d6329b0ab 100644 --- a/src/Command/Team/Project/TeamProjectListCommand.php +++ b/src/Command/Team/Project/TeamProjectListCommand.php @@ -20,12 +20,14 @@ class TeamProjectListCommand extends TeamCommandBase { const MAX_COUNT = 200; + /** @var array */ private array $tableHeader = [ 'id' => 'Project ID', 'title' => 'Project title', 'granted_at' => 'Date added', 'updated_at' => 'Updated at', ]; + /** @var string[] */ private array $defaultColumns = ['id', 'title', 'granted_at']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) diff --git a/src/Command/Team/TeamListCommand.php b/src/Command/Team/TeamListCommand.php index 488cc0618..5213fde5e 100644 --- a/src/Command/Team/TeamListCommand.php +++ b/src/Command/Team/TeamListCommand.php @@ -22,6 +22,7 @@ #[AsCommand(name: 'team:list', description: 'List teams', aliases: ['teams'])] class TeamListCommand extends TeamCommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'ID', 'label' => 'Label', @@ -32,6 +33,7 @@ class TeamListCommand extends TeamCommandBase 'updated_at' => 'Updated at', 'granted_at' => 'Granted at', ]; + /** @var string[] */ private array $defaultColumns = ['id', 'label', 'member_count', 'project_count', 'project_permissions']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Team/User/TeamUserListCommand.php b/src/Command/Team/User/TeamUserListCommand.php index f46bcf7c2..e45ecfafd 100644 --- a/src/Command/Team/User/TeamUserListCommand.php +++ b/src/Command/Team/User/TeamUserListCommand.php @@ -18,12 +18,14 @@ #[AsCommand(name: 'team:user:list', description: 'List users in a team', aliases: ['team:users'])] class TeamUserListCommand extends TeamCommandBase { + /** @var array */ private array $tableHeader = [ 'id' => 'User ID', 'email' => 'Email address', 'created_at' => 'Date added', 'updated_at' => 'Updated at', ]; + /** @var string[] */ private array $defaultColumns = ['id', 'email', 'created_at']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/Tunnel/TunnelListCommand.php b/src/Command/Tunnel/TunnelListCommand.php index b5d254f08..37f365958 100644 --- a/src/Command/Tunnel/TunnelListCommand.php +++ b/src/Command/Tunnel/TunnelListCommand.php @@ -12,6 +12,7 @@ #[AsCommand(name: 'tunnel:list', description: 'List SSH tunnels', aliases: ['tunnels'])] class TunnelListCommand extends TunnelCommandBase { + /** @var array */ protected array $tableHeader = [ 'port' => 'Port', 'project' => 'Project', @@ -20,6 +21,7 @@ class TunnelListCommand extends TunnelCommandBase 'relationship' => 'Relationship', 'url' => 'URL', ]; + /** @var string[] */ protected array $defaultColumns = ['Port', 'Project', 'Environment', 'App', 'Relationship']; public function __construct(private readonly Config $config, private readonly Selector $selector, private readonly Table $table) { diff --git a/src/Command/User/UserListCommand.php b/src/Command/User/UserListCommand.php index 4e67697fa..e0e466942 100644 --- a/src/Command/User/UserListCommand.php +++ b/src/Command/User/UserListCommand.php @@ -16,6 +16,7 @@ #[AsCommand(name: 'user:list', description: 'List project users', aliases: ['users'])] class UserListCommand extends CommandBase { + /** @var array */ private array $tableHeader = [ 'email' => 'Email address', 'name' => 'Name', @@ -24,6 +25,7 @@ class UserListCommand extends CommandBase 'granted_at' => 'Granted at', 'updated_at' => 'Updated at', ]; + /** @var string[] */ private array $defaultColumns = ['email', 'name', 'role', 'id']; public function __construct( diff --git a/src/Command/Variable/VariableListCommand.php b/src/Command/Variable/VariableListCommand.php index 81abdc7fc..98b6d5508 100644 --- a/src/Command/Variable/VariableListCommand.php +++ b/src/Command/Variable/VariableListCommand.php @@ -18,6 +18,7 @@ #[AsCommand(name: 'variable:list', description: 'List variables', aliases: ['variables', 'var'])] class VariableListCommand extends CommandBase { + /** @var array */ private array $tableHeader = [ 'name' => 'Name', 'level' => 'Level', diff --git a/src/Command/Worker/WorkerListCommand.php b/src/Command/Worker/WorkerListCommand.php index 91ee2b8f0..be450f88a 100644 --- a/src/Command/Worker/WorkerListCommand.php +++ b/src/Command/Worker/WorkerListCommand.php @@ -17,6 +17,7 @@ #[AsCommand(name: 'worker:list', description: 'Get a list of all deployed workers', aliases: ['workers'])] class WorkerListCommand extends CommandBase { + /** @var array */ private array $tableHeader = ['Name', 'Type', 'Commands']; public function __construct(private readonly Api $api, private readonly Config $config, private readonly PropertyFormatter $propertyFormatter, private readonly Selector $selector, private readonly Table $table) diff --git a/src/Service/Table.php b/src/Service/Table.php index 3ef6a1331..d95a9a768 100644 --- a/src/Service/Table.php +++ b/src/Service/Table.php @@ -49,7 +49,7 @@ public function __construct(protected InputInterface $input, protected OutputInt * Add the --format and --columns options to a command's input definition. * * @param InputDefinition $definition - * @param array $columns + * @param array $columns * The table header or a list of available columns. * @param string[] $defaultColumns * A list of default columns. @@ -77,6 +77,12 @@ public static function configureInput(InputDefinition $definition, array $column $definition->addOption($option); } + /** + * @param array $columns + * @param string[] $defaultColumns + * @param bool $markDefault + * @return string + */ private static function formatAvailableColumns(array $columns, array $defaultColumns = [], bool $markDefault = true): string { $columnNames = array_keys(self::availableColumns($columns));