Build/Test tools: Update the `WP_PHPUnit_Util_Getopt` class for PHP 7.2 compatibility.

This removes usage of `each()` which is deprecated in PHP 7.2.

Props ayeshrajans

See #40109
Fixes #41525


git-svn-id: https://develop.svn.wordpress.org/trunk@41636 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2017-09-28 23:14:26 +00:00
parent 4277df991d
commit 58140009e5
1 changed files with 3 additions and 1 deletions

View File

@ -132,7 +132,9 @@ class WP_PHPUnit_Util_Getopt extends PHPUnit_Util_Getopt {
function __construct( $argv ) {
array_shift( $argv );
$options = array();
while ( list( $i, $arg ) = each( $argv ) ) {
while ( current( $argv ) ) {
$arg = current( $argv );
next( $argv );
try {
if ( strlen( $arg ) > 1 && $arg[0] === '-' && $arg[1] === '-' ) {
PHPUnit_Util_Getopt::parseLongOption( substr( $arg, 2 ), $this->longOptions, $options, $argv );