Make WordPress Core

Changeset 56178


Ignore:
Timestamp:
07/09/2023 09:23:34 PM (3 years ago)
Author:
audrasjb
Message:

Docs: Replace multiple single line comments with multi-line comments.

This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#5-inline-comments.

Follow-up to [56174], [56175], [56176], [56177].

Props costdev, audrasjb.
See #58459.

Location:
trunk/src/wp-includes
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r55404 r56178  
    103103                }
    104104
    105                 // setIteratorIndex is optional unless mime is an animated format.
    106                 // Here, we just say no if you are missing it and aren't loading a jpeg.
     105                /*
     106                 * setIteratorIndex is optional unless mime is an animated format.
     107                 * Here, we just say no if you are missing it and aren't loading a jpeg.
     108                 */
    107109                if ( ! method_exists( 'Imagick', 'setIteratorIndex' ) && 'image/jpeg' !== $mime_type ) {
    108110                                return false;
     
    603605
    604606                        if ( $dst_w || $dst_h ) {
    605                                 // If destination width/height isn't specified,
    606                                 // use same as width/height from source.
     607                                /*
     608                                 * If destination width/height isn't specified,
     609                                 * use same as width/height from source.
     610                                 */
    607611                                if ( ! $dst_w ) {
    608612                                        $dst_w = $src_w;
     
    958962        protected function pdf_setup() {
    959963                try {
    960                         // By default, PDFs are rendered in a very low resolution.
    961                         // We want the thumbnail to be readable, so increase the rendering DPI.
     964                        /*
     965                         * By default, PDFs are rendered in a very low resolution.
     966                         * We want the thumbnail to be readable, so increase the rendering DPI.
     967                         */
    962968                        $this->image->setResolution( 128, 128 );
    963969
     
    987993
    988994                try {
    989                         // When generating thumbnails from cropped PDF pages, Imagemagick uses the uncropped
    990                         // area (resulting in unnecessary whitespace) unless the following option is set.
     995                        /*
     996                         * When generating thumbnails from cropped PDF pages, Imagemagick uses the uncropped
     997                         * area (resulting in unnecessary whitespace) unless the following option is set.
     998                         */
    991999                        $this->image->setOption( 'pdf:use-cropbox', true );
    9921000
    993                         // Reading image after Imagick instantiation because `setResolution`
    994                         // only applies correctly before the image is read.
     1001                        /*
     1002                         * Reading image after Imagick instantiation because `setResolution`
     1003                         * only applies correctly before the image is read.
     1004                         */
    9951005                        $this->image->readImage( $filename );
    9961006                } catch ( Exception $e ) {
  • trunk/src/wp-includes/class-wp-image-editor.php

    r54417 r56178  
    350350                }
    351351
    352                 // Check to see if specified mime-type is the same as type implied by
    353                 // file extension. If so, prefer extension from file.
     352                /*
     353                 * Check to see if specified mime-type is the same as type implied by
     354                 * file extension. If so, prefer extension from file.
     355                 */
    354356                if ( ! $mime_type || ( $file_mime == $mime_type ) ) {
    355357                        $mime_type = $file_mime;
     
    385387                }
    386388
    387                 // Double-check that the mime-type selected is supported by the editor.
    388                 // If not, choose a default instead.
     389                /*
     390                 * Double-check that the mime-type selected is supported by the editor.
     391                 * If not, choose a default instead.
     392                 */
    389393                if ( ! $this->supports_mime_type( $mime_type ) ) {
    390394                        /**
     
    401405                }
    402406
    403                 // Ensure both $filename and $new_ext are not empty.
    404                 // $this->get_extension() returns false on error which would effectively remove the extension
    405                 // from $filename. That shouldn't happen, files without extensions are not supported.
     407                /*
     408                 * Ensure both $filename and $new_ext are not empty.
     409                 * $this->get_extension() returns false on error which would effectively remove the extension
     410                 * from $filename. That shouldn't happen, files without extensions are not supported.
     411                 */
    406412                if ( $filename && $new_ext ) {
    407413                        $dir = pathinfo( $filename, PATHINFO_DIRNAME );
     
    516522                                break;
    517523                        case 3:
    518                                 // Rotate 180 degrees or flip horizontally and vertically.
    519                                 // Flipping seems faster and uses less resources.
     524                                /*
     525                                 * Rotate 180 degrees or flip horizontally and vertically.
     526                                 * Flipping seems faster and uses less resources.
     527                                 */
    520528                                $result = $this->flip( true, true );
    521529                                break;
  • trunk/src/wp-includes/class-wp-locale-switcher.php

    r55298 r56178  
    256256                        }
    257257
    258                         // Unload current text domain but allow them to be reloaded
    259                         // after switching back or to another locale.
     258                        /*
     259                         * Unload current text domain but allow them to be reloaded
     260                         * after switching back or to another locale.
     261                         */
    260262                        unload_textdomain( $domain, true );
    261263                        get_translations_for_domain( $domain );
  • trunk/src/wp-includes/class-wp-locale.php

    r55351 r56178  
    220220                $this->meridiem['PM'] = __( 'PM' );
    221221
    222                 // Numbers formatting.
    223                 // See https://www.php.net/number_format
     222                /*
     223                 * Numbers formatting.
     224                 * See https://www.php.net/number_format
     225                 */
    224226
    225227                /* translators: $thousands_sep argument for https://www.php.net/number_format, default is ',' */
  • trunk/src/wp-includes/class-wp-oembed.php

    r55988 r56178  
    621621
    622622                if ( PHP_VERSION_ID < 80000 ) {
    623                         // This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading
    624                         // is disabled by default, so this function is no longer needed to protect against XXE attacks.
    625                         // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.libxml_disable_entity_loaderDeprecated
     623                        /*
     624                         * This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading
     625                         * is disabled by default, so this function is no longer needed to protect against XXE attacks.
     626                         */
    626627                        $loader = libxml_disable_entity_loader( true );
    627628                }
  • trunk/src/wp-includes/class-wp-query.php

    r56019 r56178  
    16171617                        }
    16181618
    1619                         // Sanity limit, sort as sentence when more than 6 terms
    1620                         // (few searches are longer than 6 terms and most titles are not).
     1619                        /*
     1620                         * Sanity limit, sort as sentence when more than 6 terms
     1621                         * (few searches are longer than 6 terms and most titles are not).
     1622                         */
    16211623                        if ( $num_terms < 7 ) {
    16221624                                // All words in title.
     
    35103512                }
    35113513
    3512                 // Ensure that any posts added/modified via one of the filters above are
    3513                 // of the type WP_Post and are filtered.
     3514                /*
     3515                 * Ensure that any posts added/modified via one of the filters above are
     3516                 * of the type WP_Post and are filtered.
     3517                 */
    35143518                if ( $this->posts ) {
    35153519                        $this->post_count = count( $this->posts );
     
    35543558                global $wpdb;
    35553559
    3556                 // Bail if posts is an empty array. Continue if posts is an empty string,
    3557                 // null, or false to accommodate caching plugins that fill posts later.
     3560                /*
     3561                 * Bail if posts is an empty array. Continue if posts is an empty string,
     3562                 * null, or false to accommodate caching plugins that fill posts later.
     3563                 */
    35583564                if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) ) {
    35593565                        return;
  • trunk/src/wp-includes/class-wp-text-diff-renderer-table.php

    r55276 r56178  
    286286                                        // Length of all text between <ins> or <del>.
    287287                                        $stripped_matches = strlen( strip_tags( implode( ' ', $diff_matches[0] ) ) );
    288                                         // Since we count length of text between <ins> or <del> (instead of picking just one),
    289                                         // we double the length of chars not in those tags.
     288                                        /*
     289                                         * Since we count length of text between <ins> or <del> (instead of picking just one),
     290                                         * we double the length of chars not in those tags.
     291                                         */
    290292                                        $stripped_diff = strlen( strip_tags( $diff ) ) * 2 - $stripped_matches;
    291293                                        $diff_ratio    = $stripped_matches / $stripped_diff;
     
    417419                $final_rows     = array_keys( $final_matches );
    418420
    419                 // Interleaves rows with blanks to keep matches aligned.
    420                 // We may end up with some extraneous blank rows, but we'll just ignore them later.
     421                /*
     422                 * Interleaves rows with blanks to keep matches aligned.
     423                 * We may end up with some extraneous blank rows, but we'll just ignore them later.
     424                 */
    421425                foreach ( $orig_rows_copy as $orig_row ) {
    422426                        $final_pos = array_search( $orig_matches[ $orig_row ], $final_rows, true );
  • trunk/src/wp-includes/class-wp-textdomain-registry.php

    r55865 r56178  
    202202                }
    203203
    204                 // If no path is found for the given locale and a custom path has been set
    205                 // using load_plugin_textdomain/load_theme_textdomain, use that one.
     204                /*
     205                 * If no path is found for the given locale and a custom path has been set
     206                 * using load_plugin_textdomain/load_theme_textdomain, use that one.
     207                 */
    206208                if ( 'en_US' !== $locale && isset( $this->custom_paths[ $domain ] ) ) {
    207209                        $fallback_location = rtrim( $this->custom_paths[ $domain ], '/' ) . '/';
Note: See TracChangeset for help on using the changeset viewer.