diff --git .travis.yml .travis.yml
index 710a6207f..5077ae50b 100644
|
|
|
matrix: |
| 40 | 40 | env: WP_VERSION=master BP_TRAVISCI=travis:grunt |
| 41 | 41 | - php: 7.3 |
| 42 | 42 | env: WP_VERSION=master BP_TRAVISCI=travis:phpcompat |
| 43 | | - php: 5.3 |
| 44 | | env: WP_VERSION=4.8 BP_TRAVISCI=travis:phpunit |
| 45 | | dist: precise |
| 46 | 43 | exclude: |
| 47 | 44 | - php: 7.3 |
| 48 | 45 | env: WP_VERSION=4.9 BP_TRAVISCI=travis:phpunit |
| … |
… |
before_install: |
| 100 | 97 | |
| 101 | 98 | # before_script: Failures in this section will result in build status 'errored' |
| 102 | 99 | before_script: |
| 103 | | - if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]]; then composer global require --dev phpunit/phpunit ^4; fi |
| 104 | 100 | - if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then composer global require --dev phpunit/phpunit ^5; composer install; fi |
| 105 | 101 | - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then composer global require --dev phpunit/phpunit ^6; composer install; fi |
| 106 | 102 | - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" ]]; then composer global require --dev phpunit/phpunit ^6; composer install; fi |
diff --git Gruntfile.js Gruntfile.js
index d6d85bb6f..590b38872 100644
|
|
|
module.exports = function( grunt ) { |
| 269 | 269 | } |
| 270 | 270 | }, |
| 271 | 271 | phplint: { |
| 272 | | good: ['src/**/*.php', '!src/bp-core/compat/php56/*.php'].concat( BP_EXCLUDED_MISC ) |
| | 272 | good: ['src/**/*.php'].concat( BP_EXCLUDED_MISC ) |
| 273 | 273 | }, |
| 274 | 274 | postcss: { |
| 275 | 275 | options: { |
| … |
… |
module.exports = function( grunt ) { |
| 325 | 325 | stdout: false |
| 326 | 326 | }, |
| 327 | 327 | phpcompat: { |
| 328 | | command: './vendor/bin/phpcs -p --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 5.3- src tests', |
| | 328 | command: './vendor/bin/phpcs -p --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 5.6- src tests', |
| 329 | 329 | stdout: true |
| 330 | 330 | }, |
| 331 | 331 | rest_api: { |
diff --git src/bp-core/classes/class-bp-walker-nav-menu.php src/bp-core/classes/class-bp-walker-nav-menu.php
index b5c11e11d..250687e98 100644
|
|
|
|
| 11 | 11 | defined( 'ABSPATH' ) || exit; |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | | * Compatibility Class to make BP_Walker_Nav_Menu::walk() compatible |
| 15 | | * from PHP 5.3 to 5.6 and up. |
| | 14 | * Create HTML list of BP nav items. |
| 16 | 15 | * |
| 17 | | * @since 5.1.0 |
| | 16 | * @since 1.7.0 |
| 18 | 17 | */ |
| 19 | | class BP_Walker_Nav_Menu_Compat extends Walker_Nav_Menu { |
| | 18 | class BP_Walker_Nav_Menu extends Walker_Nav_Menu { |
| 20 | 19 | /** |
| 21 | 20 | * Description of fields indexes for building markup. |
| 22 | 21 | * |
| … |
… |
class BP_Walker_Nav_Menu_Compat extends Walker_Nav_Menu { |
| 131 | 130 | return $output; |
| 132 | 131 | } |
| 133 | 132 | |
| | 133 | /** |
| | 134 | * Overrides Walker::walk() method. |
| | 135 | * |
| | 136 | * @since 6.0.0 Formalized the existing `...$args` parameter by adding it |
| | 137 | * to the function signature to match WordPress 5.3. |
| | 138 | * |
| | 139 | * @param array $elements See {@link Walker::walk()}. |
| | 140 | * @param int $max_depth See {@link Walker::walk()}. |
| | 141 | * @param mixed ...$args See {@link Walker::walk()}. |
| | 142 | */ |
| | 143 | public function walk( $elements, $max_depth, ...$args ) { |
| | 144 | return $this->do_walk( $elements, $max_depth, $args ); |
| | 145 | } |
| | 146 | |
| 134 | 147 | /** |
| 135 | 148 | * Display the current <li> that we are on. |
| 136 | 149 | * |
| … |
… |
class BP_Walker_Nav_Menu_Compat extends Walker_Nav_Menu { |
| 212 | 225 | $output .= apply_filters( 'bp_walker_nav_menu_start_el', $item_output, $item, $depth, $args ); |
| 213 | 226 | } |
| 214 | 227 | } |
| 215 | | |
| 216 | | if ( PHP_VERSION_ID >= 50600 ) { |
| 217 | | require_once dirname( __DIR__ ) . '/compat/php56/class-bp-compat-walker-nav-menu.php'; |
| 218 | | } else { |
| 219 | | require_once dirname( __DIR__ ) . '/compat/php53/class-bp-compat-walker-nav-menu.php'; |
| 220 | | } |
diff --git src/bp-core/compat/php53/class-bp-compat-walker-nav-menu.php src/bp-core/compat/php53/class-bp-compat-walker-nav-menu.php
deleted file mode 100644
index 7bfc6f9c8..000000000
|
+
|
-
|
|
| 1 | | <?php |
| 2 | | /** |
| 3 | | * Walker_Nav_Menu Compat for PHP 5.3 and UP. |
| 4 | | * |
| 5 | | * @package BuddyPress |
| 6 | | * @subpackage Core |
| 7 | | * @since 5.1.0 |
| 8 | | */ |
| 9 | | |
| 10 | | // Exit if accessed directly. |
| 11 | | defined( 'ABSPATH' ) || exit; |
| 12 | | |
| 13 | | /** |
| 14 | | * Create HTML list of BP nav items. |
| 15 | | * |
| 16 | | * @since 1.7.0 |
| 17 | | */ |
| 18 | | class BP_Walker_Nav_Menu extends BP_Walker_Nav_Menu_Compat { |
| 19 | | /** |
| 20 | | * Compat method to extend Walker_Nav_Menu::walk() in PHP < 5.6. |
| 21 | | * |
| 22 | | * @since 5.1.0 |
| 23 | | * |
| 24 | | * @param array $elements See {@link Walker::walk()}. |
| 25 | | * @param int $max_depth See {@link Walker::walk()}. |
| 26 | | */ |
| 27 | | public function walk( $elements, $max_depth ) { |
| 28 | | $args = array_slice( func_get_args(), 2 ); |
| 29 | | |
| 30 | | return $this->do_walk( $elements, $max_depth, $args ); |
| 31 | | } |
| 32 | | } |
diff --git src/bp-core/compat/php56/class-bp-compat-walker-nav-menu.php src/bp-core/compat/php56/class-bp-compat-walker-nav-menu.php
deleted file mode 100644
index 0e35f37cc..000000000
|
+
|
-
|
|
| 1 | | <?php |
| 2 | | /** |
| 3 | | * Walker_Nav_Menu Compat for PHP 5.6 and UP. |
| 4 | | * |
| 5 | | * @package BuddyPress |
| 6 | | * @subpackage Core |
| 7 | | * @since 5.1.0 |
| 8 | | */ |
| 9 | | |
| 10 | | // Exit if accessed directly. |
| 11 | | defined( 'ABSPATH' ) || exit; |
| 12 | | |
| 13 | | /** |
| 14 | | * Create HTML list of BP nav items. |
| 15 | | * |
| 16 | | * @since 1.7.0 |
| 17 | | */ |
| 18 | | class BP_Walker_Nav_Menu extends BP_Walker_Nav_Menu_Compat { |
| 19 | | /** |
| 20 | | * Compat method to extend Walker_Nav_Menu::walk() in PHP > 5.6. |
| 21 | | * |
| 22 | | * @since 5.1.0 |
| 23 | | * |
| 24 | | * @param array $elements See {@link Walker::walk()}. |
| 25 | | * @param int $max_depth See {@link Walker::walk()}. |
| 26 | | * @param mixed ...$args See {@link Walker::walk()}. |
| 27 | | */ |
| 28 | | public function walk( $elements, $max_depth, ...$args ) { // phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ellipsisFound |
| 29 | | return $this->do_walk( $elements, $max_depth, $args ); |
| 30 | | } |
| 31 | | } |
diff --git src/readme.txt src/readme.txt
index 843a9bb69..87822b1a5 100644
|
|
|
Contributors: johnjamesjacoby, DJPaul, boonebgorges, r-a-y, imath, mercime, tw21 |
| 3 | 3 | Tags: user profiles, activity streams, messaging, friends, user groups, notifications, community, social networking, intranet |
| 4 | 4 | Requires at least: 4.8 |
| 5 | 5 | Tested up to: 5.2 |
| 6 | | Requires PHP: 5.3 |
| | 6 | Requires PHP: 5.6 |
| 7 | 7 | Stable tag: 5.0.0 |
| 8 | 8 | License: GPLv2 or later |
| 9 | 9 | License URI: https://www.gnu.org/licenses/gpl-2.0.html |