Skip to content
5 changes: 5 additions & 0 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: CS
on:
# Run on all relevant pushes (except to main) and on all relevant pull requests.
push:
branches:
- main
- develop
- 'release/[0-9]+.[0-9]+*'
- 'hotfix/[0-9]+.[0-9]+*'
paths:
- '**.php'
- 'composer.json'
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Test
on:
# Run on pushes to select branches and on all pull requests.
push:
branches:
- main
- develop
- 'release/[0-9]+.[0-9]+*'
- 'hotfix/[0-9]+.[0-9]+*'
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ env:
on:
push:
branches:
- main
- develop
- 'release/[0-9]+.[0-9]+*'
- 'hotfix/[0-9]+.[0-9]+*'
pull_request:

jobs:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Security
on:
# Run on all pushes and on all pull requests.
push:
branches:
- main
- develop
- 'release/[0-9]+.[0-9]+*'
- 'hotfix/[0-9]+.[0-9]+*'
pull_request:
# Also run this workflow every Monday at 6:00.
schedule:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/upgrade-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ env:
on:
push:
branches:
- main
- develop
- 'release/[0-9]+.[0-9]+*'
- 'hotfix/[0-9]+.[0-9]+*'
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:
Expand Down Expand Up @@ -135,4 +138,4 @@ jobs:
docker exec $WP_CONTAINER wp plugin activate wordpress-seo-premium --allow-root

# Show plugin settings
docker exec $WP_CONTAINER wp option get progress_planner_settings --allow-root
docker exec $WP_CONTAINER wp option get progress_planner_settings --allow-root
20 changes: 19 additions & 1 deletion classes/wp-cli/class-task-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,25 @@ public function get( $args, $assoc_args ) {
}

$format = isset( $assoc_args['format'] ) ? $assoc_args['format'] : 'table';
\WP_CLI\Utils\format_items( $format, [ $task ], \array_keys( $task ) ); // @phpstan-ignore-line
$fields = [ 'task_id', 'provider_id', 'date', 'post_status' ];

$formatted = [];
foreach ( $fields as $field ) {
switch ( $field ) {
case 'task_id':
case 'date':
case 'post_status':
$formatted[ $field ] = $task->$field ?? '';
break;
case 'provider_id':
$formatted[ $field ] = \is_object( $task->provider ?? null ) && isset( $task->provider->name ) ? $task->provider->name : '';
break;
default:
$formatted[ $field ] = $task->$field ?? '';
}
}

\WP_CLI\Utils\format_items( $format, [ $formatted ], $fields ); // @phpstan-ignore-line
}

/**
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"szepeviktor/phpstan-wordpress": "^2.0",
"phpstan/extension-installer": "^1.4",
"yoast/yoastcs": "^3.0",
"friendsofphp/php-cs-fixer": "^3.75"
"friendsofphp/php-cs-fixer": "^3.75",
"wp-cli/wp-cli-bundle": "^2.11"
},
"suggest": {
"ext-pcov": "Recommended for fast code coverage generation (5x faster than Xdebug)",
Expand Down
Loading
Loading