Skip to content

Commit eeb4a55

Browse files
committed
Refactor single each() usage to key() and current()
The each() function has been deprecated since PHP 7.2 and shouldn't be used anymore: - http://php.net/manual/en/function.each.php
1 parent bde0938 commit eeb4a55

File tree

1 file changed

+4
-2
lines changed
  • PEAR/PackageFile/Generator

1 file changed

+4
-2
lines changed

PEAR/PackageFile/Generator/v1.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,10 @@ function _convertDependencies2_0(&$release, $internal = false)
738738
$php = $this->_processPhpDeps($deps['php']);
739739
} else {
740740
if (!isset($deps['php'][0])) {
741-
list($key, $blah) = each ($deps['php']); // stupid buggy versions
742-
$deps['php'] = array($blah[0]);
741+
// Buggy versions
742+
$key = key($deps['php']);
743+
$info = current($deps['php']);
744+
$deps['php'] = array($info[0]);
743745
}
744746
$php = $this->_processDep($deps['php'][0]);
745747
if (!$php) {

0 commit comments

Comments
 (0)