-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix spacing issues and improve function docs
- Loading branch information
1 parent
1934de3
commit c6680b1
Showing
1 changed file
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,6 @@ public function check( $args, $assoc_args ) { | |
'ignore-warnings' => false, | ||
'ignore-errors' => false, | ||
'include-experimental' => false, | ||
|
||
) | ||
); | ||
|
||
|
@@ -236,7 +235,7 @@ static function ( $dirs ) use ( $excluded_directories ) { | |
} | ||
|
||
/** | ||
* Runs plugin list-checks. | ||
* Lists the available checks for plugins. | ||
* | ||
* ## OPTIONS | ||
* | ||
|
@@ -260,16 +259,14 @@ static function ( $dirs ) use ( $excluded_directories ) { | |
* @param array $args List of the positional arguments. | ||
* @param array $assoc_args List of the associative arguments. | ||
* | ||
* @throws WP_CLI\ExitException Show error if not valid runner. | ||
* @throws WP_CLI Show error if invalid format argument. | ||
*/ | ||
public function list_checks( $args, $assoc_args ) { | ||
Check failure on line 264 in includes/CLI/Plugin_Check_Command.php GitHub Actions / PHP
|
||
$check_repo = new Default_Check_Repository(); | ||
|
||
$all_checks = array(); | ||
|
||
$checks_items = $check_repo->get_checks()->to_map(); | ||
|
||
foreach ( $checks_items as $key => $check ) { | ||
foreach ( $check_repo->get_checks() as $key => $check ) { | ||
$item = array(); | ||
|
||
$item['slug'] = $key; | ||
|
@@ -297,7 +294,7 @@ public function list_checks( $args, $assoc_args ) { | |
} | ||
|
||
/** | ||
* Runs plugin list-check-categories. | ||
* Lists the available check categories for plugins. | ||
* | ||
* ## OPTIONS | ||
* | ||
|
@@ -325,6 +322,8 @@ public function list_checks( $args, $assoc_args ) { | |
* | ||
* @param array $args List of the positional arguments. | ||
* @param array $assoc_args List of the associative arguments. | ||
* | ||
* @throws WP_CLI Show error if invalid format argument. | ||
*/ | ||
public function list_check_categories( $args, $assoc_args ) { | ||
Check failure on line 328 in includes/CLI/Plugin_Check_Command.php GitHub Actions / PHP
|
||
// Get options based on the CLI arguments. | ||
|
@@ -354,12 +353,10 @@ public function list_check_categories( $args, $assoc_args ) { | |
* @return array List of the check categories. | ||
*/ | ||
private function get_check_categories() { | ||
$categories = array(); | ||
|
||
$check_categories = new Check_Categories(); | ||
$categories_slugs = $check_categories->get_categories(); | ||
|
||
$categories = array_map( | ||
return array_map( | ||
function ( $slug ) { | ||
return array( | ||
'slug' => $slug, | ||
|
@@ -368,8 +365,6 @@ function ( $slug ) { | |
}, | ||
$categories_slugs | ||
); | ||
|
||
return $categories; | ||
} | ||
|
||
/** | ||
|