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:
parent
4277df991d
commit
58140009e5
@ -132,7 +132,9 @@ class WP_PHPUnit_Util_Getopt extends PHPUnit_Util_Getopt {
|
|||||||
function __construct( $argv ) {
|
function __construct( $argv ) {
|
||||||
array_shift( $argv );
|
array_shift( $argv );
|
||||||
$options = array();
|
$options = array();
|
||||||
while ( list( $i, $arg ) = each( $argv ) ) {
|
while ( current( $argv ) ) {
|
||||||
|
$arg = current( $argv );
|
||||||
|
next( $argv );
|
||||||
try {
|
try {
|
||||||
if ( strlen( $arg ) > 1 && $arg[0] === '-' && $arg[1] === '-' ) {
|
if ( strlen( $arg ) > 1 && $arg[0] === '-' && $arg[1] === '-' ) {
|
||||||
PHPUnit_Util_Getopt::parseLongOption( substr( $arg, 2 ), $this->longOptions, $options, $argv );
|
PHPUnit_Util_Getopt::parseLongOption( substr( $arg, 2 ), $this->longOptions, $options, $argv );
|
||||||
|
Loading…
Reference in New Issue
Block a user