Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 2d54420

Browse files
author
Jonny Bull
committed
Overly fussy standards fixes
1 parent 1673cc7 commit 2d54420

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

flagpole.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function flagpole_admin_imports( $hook ) {
102102
require plugin_dir_path( __FILE__ ) . 'includes/api/api.shortcode.php';
103103

104104
if ( defined( '\WP_CLI' ) && \WP_CLI ) {
105-
require plugin_dir_path( __FILE__ ) . 'includes/class-cli.php';
105+
require_once( plugin_dir_path( __FILE__ ) . 'includes/class-cli.php' );
106106
}
107107

108108
/**

includes/class-cli.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private function flag_list_data_encode( $data, $bool_type = 'string' ) {
9292
* wp flagpole list csv
9393
*
9494
*/
95-
public function flag_list( $args, $assoc_args ) {
95+
public function flag_list( $args ) {
9696
/**
9797
* @todo switch to associated arguments only.
9898
* @todo filter by group/label.
@@ -101,7 +101,7 @@ public function flag_list( $args, $assoc_args ) {
101101
*/
102102

103103
// We don't support the 'ids' or 'count' types, as there's no real benefit to them here.
104-
$supported_render_types = [
104+
$render_types = [
105105
'table',
106106
'csv',
107107
'json',
@@ -110,11 +110,11 @@ public function flag_list( $args, $assoc_args ) {
110110

111111
$render_type = 'table';
112112

113-
if ( $args !== [] and in_array( $args[0], $supported_render_types, true ) ) {
113+
if ( $args !== [] and in_array( $args[0], $render_types, true ) ) {
114114
$render_type = $args[0];
115115
}
116116

117-
$flagpole_available_flags = Flagpole::init()->get_flags();
117+
$available_flags = Flagpole::init()->get_flags();
118118

119119
$fields_to_display = [
120120
'key',
@@ -133,15 +133,15 @@ public function flag_list( $args, $assoc_args ) {
133133
$bool_type = 'string';
134134
}
135135

136-
$flagpole_available_flags = $this->flag_list_data_encode( $flagpole_available_flags, $bool_type );
136+
$available_flags = $this->flag_list_data_encode( $available_flags, $bool_type );
137137

138-
$enabled_flags = array_filter( $flagpole_available_flags, [ $this, 'flag_filter_enabled' ] );
138+
$enabled_flags = array_filter( $available_flags, [ $this, 'flag_filter_enabled' ] );
139139

140-
WP_CLI::line( 'Flags: ' . count( $flagpole_available_flags ) . ' registered. ' . count( $enabled_flags ) . ' enabled.' );
140+
WP_CLI::line( 'Flags: ' . count( $available_flags ) . ' registered. ' . count( $enabled_flags ) . ' enabled.' );
141141
WP_CLI::line();
142142

143-
if ( count( $flagpole_available_flags ) > 0 ) {
144-
WP_CLI\Utils\format_items( $render_type, $flagpole_available_flags, $fields_to_display );
143+
if ( count( $available_flags ) > 0 ) {
144+
WP_CLI\Utils\format_items( $render_type, $available_flags, $fields_to_display );
145145
WP_CLI::line();
146146
}
147147
}
@@ -163,7 +163,7 @@ public function flag_list( $args, $assoc_args ) {
163163
*
164164
* @alias on
165165
*/
166-
public function flag_on( $args, $assoc_args ) {
166+
public function flag_on( $args ) {
167167
if ( $args == [] ) {
168168
WP_CLI::error( 'Flag not provided' );
169169
return;
@@ -203,7 +203,7 @@ public function flag_on( $args, $assoc_args ) {
203203
*
204204
* @alias off
205205
*/
206-
public function flag_off( $args, $assoc_args ) {
206+
public function flag_off( $args ) {
207207
if ( $args == [] ) {
208208
WP_CLI::error( 'Flag not provided' );
209209
return;
@@ -239,7 +239,7 @@ public function flag_off( $args, $assoc_args ) {
239239
* wp flagpole toggle my-example-flag,my-other-example-flag
240240
*
241241
*/
242-
public function flag_toggle( $args, $assoc_args ) {
242+
public function flag_toggle( $args ) {
243243
if ( $args == [] ) {
244244
WP_CLI::error( 'Flag not provided' );
245245
return;

0 commit comments

Comments
 (0)