OSDN Git Service

enable DisallowSpaceIndent sniff
authorscribu <mail@scribu.net>
Sun, 13 Oct 2013 14:07:26 +0000 (17:07 +0300)
committerscribu <mail@scribu.net>
Sun, 13 Oct 2013 14:07:26 +0000 (17:07 +0300)
ci/ruleset.xml
php/WP_CLI/Configurator.php
php/WP_CLI/Runner.php
php/WP_CLI/SynopsisParser.php
php/boot-fs.php
php/commands/help.php
php/commands/search-replace.php

index 29a843d..6246770 100644 (file)
@@ -4,6 +4,8 @@
 
        <exclude-pattern>php/Spyc.php</exclude-pattern>
 
+       <rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
+
        <rule ref="Generic.CodeAnalysis.VariableAnalysis">
                <exclude name="Generic.CodeAnalysis.VariableAnalysis.UnusedVariable"/>
 
index 239e95f..1065fe4 100644 (file)
@@ -93,7 +93,7 @@ class Configurator {
                                        $value = array( $value );
                                }
                        } else {
-                                $value = $details['default'];
+                               $value = $details['default'];
                        }
 
                        $sanitized_config[ $key ] = $value;
index 7ac2e56..c3b52e1 100644 (file)
@@ -426,8 +426,7 @@ class Runner {
                self::set_wp_root( $this->config );
 
                // First try at showing man page
-               if ( 'help' === $this->arguments[0] &&
-                  ( isset( $this->arguments[1] ) || !$this->wp_exists() ) ) {
+               if ( 'help' === $this->arguments[0] && ( isset( $this->arguments[1] ) || !$this->wp_exists() ) ) {
                        $this->_run_command();
                }
 
index 37cc3ac..4996000 100644 (file)
@@ -17,9 +17,7 @@ class SynopsisParser {
 
                        // Some types of parameters shouldn't be mandatory
                        if ( isset( $param['optional'] ) && !$param['optional'] ) {
-                               if ( 'flag' === $param['type'] ||
-                                  ( 'assoc' === $param['type'] && $param['value']['optional'] )
-                               ) {
+                               if ( 'flag' === $param['type'] || ( 'assoc' === $param['type'] && $param['value']['optional'] ) ) {
                                        $param['type'] = 'unknown';
                                }
                        }
index 7a13744..c39ea2a 100644 (file)
@@ -8,7 +8,7 @@ if ( 'cli' !== PHP_SAPI ) {
 }
 
 if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) {
-    printf( "Error: WP-CLI requires PHP %s or newer. You are running version %s.\n", '5.3.0', PHP_VERSION );
+       printf( "Error: WP-CLI requires PHP %s or newer. You are running version %s.\n", '5.3.0', PHP_VERSION );
        die(-1);
 }
 
index c56e47f..d7eb30c 100644 (file)
@@ -116,7 +116,7 @@ class Help_Command extends WP_CLI_Command {
        private static function render_subcommands( $command ) {
                $subcommands = array();
                foreach ( $command->get_subcommands() as $subcommand ) {
-                        $subcommands[ $subcommand->get_name() ] = $subcommand->get_shortdesc();
+                       $subcommands[ $subcommand->get_name() ] = $subcommand->get_shortdesc();
                }
 
                $max_len = self::get_max_len( array_keys( $subcommands ) );
index fbeeec1..24f3d0f 100644 (file)
@@ -73,8 +73,7 @@ class Search_Replace_Command extends WP_CLI_Command {
                                if ( in_array( $col, $skip_columns ) )
                                        continue;
 
-                               $count = self::handle_col( $col, $primary_key, $table, $old, $new,
-                                        $dry_run );
+                               $count = self::handle_col( $col, $primary_key, $table, $old, $new, $dry_run );
 
                                $report[] = array( $table, $col, $count );