diff -ruN ./vendor/phpunit/phpunit/src/Framework/Constraint.php ./vendor/phpunit/phpunit/src/Framework/Constraint.php --- ./vendor/phpunit/phpunit/src/Framework/Constraint.php 2017-06-21 10:07:12.000000000 +0200 +++ ./vendor/phpunit/phpunit/src/Framework/Constraint.php 2021-09-17 15:09:21.000000000 +0200 @@ -81,6 +81,7 @@ * * @since Method available since Release 3.4.0 */ + #[\ReturnTypeWillChange] public function count() { return 1; diff -ruN ./vendor/phpunit/phpunit/src/Util/Configuration.php ./vendor/phpunit/phpunit/src/Util/Configuration.php --- ./vendor/phpunit/phpunit/src/Util/Configuration.php 2017-06-21 10:07:12.000000000 +0200 +++ ./vendor/phpunit/phpunit/src/Util/Configuration.php 2021-09-17 14:46:32.000000000 +0200 @@ -162,7 +162,7 @@ /** * @since Method available since Release 3.4.0 */ - final private function __clone() + private function __clone() { } @@ -516,7 +516,7 @@ // See https://github.com/sebastianbergmann/phpunit/issues/277 switch ($array) { case 'var': - $target = &$GLOBALS; +// $target = &$GLOBALS; break; case 'server': diff -ruN ./vendor/phpunit/phpunit/src/Util/Getopt.php ./vendor/phpunit/phpunit/src/Util/Getopt.php --- ./vendor/phpunit/phpunit/src/Util/Getopt.php 2017-06-21 10:07:12.000000000 +0200 +++ ./vendor/phpunit/phpunit/src/Util/Getopt.php 2021-09-17 15:04:26.000000000 +0200 @@ -21,7 +21,7 @@ return array(array(), array()); } - $opts = array(); + $opts = array(); $non_opts = array(); if ($long_options) { @@ -35,7 +35,10 @@ reset($args); array_map('trim', $args); - while (list($i, $arg) = each($args)) { + + for ($i = 0; $i < count($args); $i++) { + $arg = $args[$i]; + if ($arg == '') { continue; } @@ -45,24 +48,30 @@ break; } + $nextArg = isset($args[$i]) ? $args[$i] : null; + if ($arg[0] != '-' || (strlen($arg) > 1 && $arg[1] == '-' && !$long_options)) { $non_opts[] = $args[$i]; continue; } elseif (strlen($arg) > 1 && $arg[1] == '-') { - self::parseLongOption( + if (self::parseLongOption( substr($arg, 2), $long_options, $opts, - $args - ); + $nextArg + )) { + $i++; + } } else { - self::parseShortOption( + if (self::parseShortOption( substr($arg, 1), $short_options, $opts, - $args - ); + $nextArg + )) { + $i++; + } } } @@ -74,7 +83,7 @@ $argLen = strlen($arg); for ($i = 0; $i < $argLen; $i++) { - $opt = $arg[$i]; + $opt = $arg[$i]; $opt_arg = null; if (($spec = strstr($short_options, $opt)) === false || @@ -107,11 +116,11 @@ } } - protected static function parseLongOption($arg, $long_options, &$opts, &$args) + protected static function parseLongOption($arg, $long_options, &$opts, $nextArg) { - $count = count($long_options); - $list = explode('=', $arg); - $opt = $list[0]; + $count = count($long_options); + $list = explode('=', $arg); + $opt = $list[0]; $opt_arg = null; if (count($list) > 1) { @@ -121,7 +130,7 @@ $opt_len = strlen($opt); for ($i = 0; $i < $count; $i++) { - $long_opt = $long_options[$i]; + $long_opt = $long_options[$i]; $opt_start = substr($long_opt, 0, $opt_len); if ($opt_start != $opt) { @@ -131,20 +140,24 @@ $opt_rest = substr($long_opt, $opt_len); if ($opt_rest != '' && $opt[0] != '=' && $i + 1 < $count && - $opt == substr($long_options[$i+1], 0, $opt_len)) { + $opt == substr($long_options[$i + 1], 0, $opt_len)) { throw new PHPUnit_Framework_Exception( "option --$opt is ambiguous" ); } + $ret = false; + if (substr($long_opt, -1) == '=') { if (substr($long_opt, -2) != '==') { - if (!strlen($opt_arg) && - !(list(, $opt_arg) = each($args))) { + if (empty($opt_arg) && + empty($nextArg) /*false*/) { throw new PHPUnit_Framework_Exception( "option --$opt requires an argument" ); } + + $ret = true; } } elseif ($opt_arg) { throw new PHPUnit_Framework_Exception( @@ -153,9 +166,9 @@ } $full_option = '--' . preg_replace('/={1,2}$/', '', $long_opt); - $opts[] = array($full_option, $opt_arg); + $opts[] = array($full_option, $opt_arg); - return; + return $ret; } throw new PHPUnit_Framework_Exception("unrecognized option --$opt");