Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions php/class-wp-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,14 @@ private static function wp_hook_build_unique_id( $tag, $function, $priority ) {
}

if ( is_object( $function ) ) {
// Closures are currently implemented as objects
// Closures are currently implemented as objects.
$function = [ $function, '' ];
} else {
$function = (array) $function;
}

if ( is_object( $function[0] ) ) {
// Object Class Calling
// Object Class Calling.
if ( function_exists( 'spl_object_hash' ) ) {
return spl_object_hash( $function[0] ) . $function[1];
}
Expand All @@ -421,7 +421,7 @@ private static function wp_hook_build_unique_id( $tag, $function, $priority ) {
}

if ( is_string( $function[0] ) ) {
// Static Calling
// Static Calling.
return $function[0] . '::' . $function[1];
}
}
Expand Down Expand Up @@ -1069,7 +1069,7 @@ public static function error_to_string( $errors ) {
return $errors;
}

// Only json_encode() the data when it needs it
// Only json_encode() the data when it needs it.
$render_data = function ( $data ) {
if ( is_array( $data ) || is_object( $data ) ) {
return json_encode( $data );
Expand Down Expand Up @@ -1457,18 +1457,18 @@ public static function run_command( $args, $assoc_args = [] ) {



// DEPRECATED STUFF
// DEPRECATED STUFF.

public static function add_man_dir() {
trigger_error( 'WP_CLI::add_man_dir() is deprecated. Add docs inline.', E_USER_WARNING );
}

// back-compat
// back-compat.
public static function out( $str ) {
fwrite( STDOUT, $str );
}

// back-compat
// back-compat.
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid -- Deprecated method.
public static function addCommand( $name, $class ) {
trigger_error(
Expand Down
12 changes: 6 additions & 6 deletions php/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function find_file_upward( $files, $dir = null, $stop_check = null ) {
}

function is_path_absolute( $path ) {
// Windows
// Windows.
if ( isset( $path[1] ) && ':' === $path[1] ) {
return true;
}
Expand Down Expand Up @@ -868,7 +868,7 @@ function get_default_cacert( $halt_on_error = false ) {
$error_msg = 'Cannot find SSL certificate.';

if ( inside_phar( $cert_path ) ) {
// cURL can't read Phar archives
// cURL can't read Phar archives.
return extract_from_phar( $cert_path );
}

Expand All @@ -895,13 +895,13 @@ function get_default_cacert( $halt_on_error = false ) {
* @return string
*/
function increment_version( $current_version, $new_version ) {
// split version assuming the format is x.y.z-pre
// split version assuming the format is x.y.z-pre.
$current_version = explode( '-', $current_version, 2 );
$current_version[0] = explode( '.', $current_version[0] );

switch ( $new_version ) {
case 'same':
// do nothing
// do nothing.
break;

case 'patch':
Expand All @@ -925,7 +925,7 @@ function increment_version( $current_version, $new_version ) {
$current_version = [ $current_version[0] ]; // Drop possible pre-release info.
break;

default: // not a keyword
default: // not a keyword.
$current_version = [ [ $new_version ] ];
break;
}
Expand Down Expand Up @@ -1007,7 +1007,7 @@ function get_flag_value( $assoc_args, $flag, $default = null ) {
function get_home_dir() {
$home = getenv( 'HOME' );
if ( ! $home ) {
// In Windows $HOME may not be defined
// In Windows $HOME may not be defined.
$home = getenv( 'HOMEDRIVE' ) . getenv( 'HOMEPATH' );
}

Expand Down
2 changes: 1 addition & 1 deletion php/wp-settings-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ function get_magic_quotes_gpc() {
*/
do_action( 'init' );

// Check site status
// Check site status.
# if ( is_multisite() ) { // WP-CLI
if ( is_multisite() && ! defined( 'WP_INSTALLING' ) ) {
$file = ms_site_check();
Expand Down