Skip to:
Content

BuddyPress.org

Ticket #8381: 8381.patch

File 8381.patch, 6.7 KB (added by imath, 5 years ago)
  • .travis.yml

    diff --git .travis.yml .travis.yml
    index d8f737f96..8c065b9e8 100644
    before_install: 
    8080
    8181  # setup NodeJS version using NVM
    8282  - export PATH="$HOME/.composer/vendor/bin:$PATH"
    83   # make sure composer is < 2.0.0 to avoid dependencies install errors.
    84   - composer self-update 1.10.16
    8583  - node --version
    8684  - nvm install 14.15.0
    8785  - node --version
  • composer.json

    diff --git composer.json composer.json
    index d07167858..3bf5b45c3 100644
     
    1313                "social network"
    1414        ],
    1515        "homepage": "https://buddypress.org",
    16         "license": "GPL-2.0+",
     16        "license": "GPL-2.0-or-later",
    1717        "authors": [ {
    1818                "name": "BuddyPress Community",
    1919                "homepage": "https://buddypress.org/about/"
     
    2727                "wiki": "https://codex.buddypress.org/"
    2828        },
    2929        "require": {
    30                 "composer/installers": "~1.0",
    31                 "php": ">=5.3.0"
     30                "composer/installers": "^1.10.0",
     31                "php": ">=5.6.0"
    3232        },
    3333        "require-dev": {
    34                 "phpcompatibility/phpcompatibility-wp": "*",
    35                 "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
    36                 "wp-phpunit/wp-phpunit": "^5.4"
     34                "phpcompatibility/phpcompatibility-wp": "^2.1.0",
     35                "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
     36                "wp-phpunit/wp-phpunit": "^5.6",
     37                "phpunit/phpunit": "^7.5"
    3738        }
    3839}
  • package.json

    diff --git package.json package.json
    index 8a9336e13..6ae270c71 100644
     
    4848                "build:components": "parcel build src/js/bp-core/js/block-components/block-components.js --out-dir build/bp-core/js --out-file block-components.js --global bp",
    4949                "wp-env": "wp-env",
    5050                "test-php": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml'",
     51                "test-php:composer": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml'",
    5152                "test-php:group": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml --group $npm_confi_g'",
     53                "test-php:composer:group": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml --group $npm_confi_g'",
    5254                "test-php-multisite": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml'",
    53                 "test-php-multisite:group": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml --group $npm_confi_g'"
     55                "test-php-multisite:composer": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml'",
     56                "test-php-multisite:group": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml --group $npm_confi_g'",
     57                "test-php-multisite:composer:group": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml --group $npm_confi_g'"
    5458        },
    5559        "keywords": [
    5660                "activity",
  • src/bp-groups/bp-groups-functions.php

    diff --git src/bp-groups/bp-groups-functions.php src/bp-groups/bp-groups-functions.php
    index 50b7b399d..d1af9ad1f 100644
    function groups_delete_invite( $user_id, $group_id, $inviter_id = false ) { 
    16691669 *     @type bool   $force_resend  Whether to resend the email & notification if one has already been sent.
    16701670 * }
    16711671 */
    1672 function groups_send_invites( $args = array() ) {
     1672function groups_send_invites( ...$args ) {
    16731673        // Backward compatibility with old method of passing arguments.
    1674         if ( ! is_array( $args ) || func_num_args() > 1 ) {
     1674        if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
    16751675                _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    16761676
    16771677                $old_args_keys = array(
    function groups_send_invites( $args = array() ) { 
    16791679                        1 => 'group_id',
    16801680                );
    16811681
    1682                 $args = bp_core_parse_args_array( $old_args_keys, func_get_args() );
     1682                $args = bp_core_parse_args_array( $old_args_keys, $args );
     1683        } else {
     1684                $args = reset( $args );
    16831685        }
    16841686
    16851687        $r = bp_parse_args( $args, array(
    function groups_remove_member( $user_id, $group_id ) { 
    20082010 * }
    20092011 * @return bool True on success, false on failure.
    20102012 */
    2011 function groups_send_membership_request( $args = array() ) {
     2013function groups_send_membership_request( ...$args ) {
    20122014        // Backward compatibility with old method of passing arguments.
    2013         if ( ! is_array( $args ) || func_num_args() > 1 ) {
     2015        if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
    20142016                _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    20152017
    20162018                $old_args_keys = array(
    function groups_send_membership_request( $args = array() ) { 
    20182020                        1 => 'group_id',
    20192021                );
    20202022
    2021                 $args = bp_core_parse_args_array( $old_args_keys, func_get_args() );
     2023                $args = bp_core_parse_args_array( $old_args_keys, $args );
     2024        } else {
     2025                $args = reset( $args );
    20222026        }
    20232027
    20242028        $r = bp_parse_args( $args, array(
  • src/bp-members/classes/class-bp-core-members-template.php

    diff --git src/bp-members/classes/class-bp-core-members-template.php src/bp-members/classes/class-bp-core-members-template.php
    index af00c6bdf..ed82ef88f 100644
    class BP_Core_Members_Template { 
    123123         *     @type string $page_arg    Optional. The string used as a query parameter in pagination links.
    124124         * }
    125125         */
    126         public function __construct( $args ) {
     126        public function __construct( ...$args ) {
    127127                // Backward compatibility with old method of passing arguments.
    128                 if ( ! is_array( $args ) || func_num_args() > 1 ) {
     128                if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
    129129                        _deprecated_argument( __METHOD__, '7.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    130130
    131131                        $old_args_keys = array(
    class BP_Core_Members_Template { 
    146146                                14 => 'member_type__not_in'
    147147                        );
    148148
    149                         $args = bp_core_parse_args_array( $old_args_keys, func_get_args() );
     149                        $args = bp_core_parse_args_array( $old_args_keys, $args );
     150                } else {
     151                        $args = reset( $args );
    150152                }
    151153
    152154                // Support both 'page_number' and 'page' for backward compatibility.