diff --git a/composer.json b/composer.json index 8b03bfc..1636801 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "wp-cli/wp-cli": "^2" }, "require-dev": { - "wp-cli/wp-cli-tests": "^3.1" + "wp-cli/wp-cli-tests": "^4" }, "config": { "platform": { diff --git a/find-command.php b/find-command.php index 38781ab..9eb0367 100644 --- a/find-command.php +++ b/find-command.php @@ -4,10 +4,9 @@ return; } -$wpcli_find_autoloader = dirname( __FILE__ ) . '/vendor/autoload.php'; +$wpcli_find_autoloader = __DIR__ . '/vendor/autoload.php'; if ( file_exists( $wpcli_find_autoloader ) ) { require_once $wpcli_find_autoloader; } WP_CLI::add_command( 'find', 'Find_Command' ); - diff --git a/src/Find_Command.php b/src/Find_Command.php index ed17859..dfb2871 100644 --- a/src/Find_Command.php +++ b/src/Find_Command.php @@ -310,9 +310,9 @@ private function recurse_directory( $path ) { $this->log( "Recursing into '{$path}'" ); foreach ( $iterator as $file_info ) { if ( $file_info->isDir() ) { - $this->current_depth++; + ++$this->current_depth; $this->recurse_directory( $file_info->getPathname() ); - $this->current_depth--; + --$this->current_depth; } } } @@ -368,5 +368,4 @@ private static function format_log_timestamp( $s ) { $s -= $m * 60; return $h . ':' . sprintf( '%02d', $m ) . ':' . sprintf( '%02d', $s ); } - }