Skip to content

Commit 52751b1

Browse files
Update Inline comments (#5910)
* Improve Inline comments * Remove period from PHPCS comment --------- Co-authored-by: Daniel Bachhuber <daniel.bachhuber@automattic.com>
1 parent 4c68c26 commit 52751b1

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

php/class-wp-cli.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,14 +393,14 @@ private static function wp_hook_build_unique_id( $tag, $function, $priority ) {
393393
}
394394

395395
if ( is_object( $function ) ) {
396-
// Closures are currently implemented as objects
396+
// Closures are currently implemented as objects.
397397
$function = [ $function, '' ];
398398
} else {
399399
$function = (array) $function;
400400
}
401401

402402
if ( is_object( $function[0] ) ) {
403-
// Object Class Calling
403+
// Object Class Calling.
404404
if ( function_exists( 'spl_object_hash' ) ) {
405405
return spl_object_hash( $function[0] ) . $function[1];
406406
}
@@ -421,7 +421,7 @@ private static function wp_hook_build_unique_id( $tag, $function, $priority ) {
421421
}
422422

423423
if ( is_string( $function[0] ) ) {
424-
// Static Calling
424+
// Static Calling.
425425
return $function[0] . '::' . $function[1];
426426
}
427427
}
@@ -1069,7 +1069,7 @@ public static function error_to_string( $errors ) {
10691069
return $errors;
10701070
}
10711071

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

14581458

14591459

1460-
// DEPRECATED STUFF
1460+
// DEPRECATED STUFF.
14611461

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

1466-
// back-compat
1466+
// back-compat.
14671467
public static function out( $str ) {
14681468
fwrite( STDOUT, $str );
14691469
}
14701470

1471-
// back-compat
1471+
// back-compat.
14721472
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid -- Deprecated method.
14731473
public static function addCommand( $name, $class ) {
14741474
trigger_error(

php/utils.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ function find_file_upward( $files, $dir = null, $stop_check = null ) {
220220
}
221221

222222
function is_path_absolute( $path ) {
223-
// Windows
223+
// Windows.
224224
if ( isset( $path[1] ) && ':' === $path[1] ) {
225225
return true;
226226
}
@@ -868,7 +868,7 @@ function get_default_cacert( $halt_on_error = false ) {
868868
$error_msg = 'Cannot find SSL certificate.';
869869

870870
if ( inside_phar( $cert_path ) ) {
871-
// cURL can't read Phar archives
871+
// cURL can't read Phar archives.
872872
return extract_from_phar( $cert_path );
873873
}
874874

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

902902
switch ( $new_version ) {
903903
case 'same':
904-
// do nothing
904+
// do nothing.
905905
break;
906906

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

928-
default: // not a keyword
928+
default: // not a keyword.
929929
$current_version = [ [ $new_version ] ];
930930
break;
931931
}
@@ -1007,7 +1007,7 @@ function get_flag_value( $assoc_args, $flag, $default = null ) {
10071007
function get_home_dir() {
10081008
$home = getenv( 'HOME' );
10091009
if ( ! $home ) {
1010-
// In Windows $HOME may not be defined
1010+
// In Windows $HOME may not be defined.
10111011
$home = getenv( 'HOMEDRIVE' ) . getenv( 'HOMEPATH' );
10121012
}
10131013

php/wp-settings-cli.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ function get_magic_quotes_gpc() {
441441
*/
442442
do_action( 'init' );
443443

444-
// Check site status
444+
// Check site status.
445445
# if ( is_multisite() ) { // WP-CLI
446446
if ( is_multisite() && ! defined( 'WP_INSTALLING' ) ) {
447447
$file = ms_site_check();

0 commit comments

Comments
 (0)