Make WordPress Core

Changeset 49186 for trunk


Ignore:
Timestamp:
10/18/2020 06:27:38 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Remove unnecessary reference sign from PO::export_entry() definition.

This fixes a PHP 8 "argument must be passed by reference, value given" error when using array_map() in PO::export_entries().

Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around.

Props jrf.
See #50913.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pomo/po.php

    r49184 r49186  
    213213                 * Builds a string from the entry for inclusion in PO file
    214214                 *
    215                  * @param Translation_Entry $entry the entry to convert to po string (passed by reference).
     215                 * @param Translation_Entry $entry the entry to convert to po string.
    216216                 * @return string|false PO-style formatted string for the entry or
    217217                 *  false if the entry is empty
    218218                 */
    219                 public static function export_entry( &$entry ) {
     219                public static function export_entry( $entry ) {
    220220                        if ( null === $entry->singular || '' === $entry->singular ) {
    221221                                return false;
Note: See TracChangeset for help on using the changeset viewer.