Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit df32cb0

Browse files
authored
Merge pull request #11 from magento-engcom/deprecated-7.2-code
Remove PHP 7.2 Incompatible Code Update or remove the following incompatible function calls: - `each()` - `create_function()` - Calls to `count()` with un-countable values - Removed `XmlRpc` component
2 parents e2693f0 + 1366f3f commit df32cb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+10
-9519
lines changed

library/Zend/Cache/Backend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function __construct(array $options = array())
7676
public function setDirectives($directives)
7777
{
7878
if (!is_array($directives)) Zend_Cache::throwException('Directives parameter must be an array');
79-
while (list($name, $value) = each($directives)) {
79+
foreach ($directives as $name => $value) {
8080
if (!is_string($name)) {
8181
Zend_Cache::throwException("Incorrect option name : $name");
8282
}

library/Zend/Cache/Frontend/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ protected function _makePartialId($arrayName, $bool1, $bool2)
395395
}
396396
return '';
397397
}
398-
if (count($var) > 0) {
398+
if (is_array($var) && count($var) > 0) {
399399
return false;
400400
}
401401
return '';

library/Zend/Config/Yaml.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ protected static function _decodeYaml($currentIndent, &$lines)
289289
{
290290
$config = array();
291291
$inIndent = false;
292-
while (list($n, $line) = each($lines)) {
292+
foreach ($line as $n => $line) {
293293
$lineno = $n + 1;
294294

295295
$line = rtrim(preg_replace("/#.*$/", "", $line));
@@ -362,11 +362,11 @@ protected static function _parseValue($value)
362362
$value = trim($value);
363363

364364
// remove quotes from string.
365-
if ('"' == $value['0']) {
366-
if ('"' == $value[count($value) -1]) {
365+
if ('"' == substr($value, 0, 1)) {
366+
if ('"' == substr($value, -1)) {
367367
$value = substr($value, 1, -1);
368368
}
369-
} elseif ('\'' == $value['0'] && '\'' == $value[count($value) -1]) {
369+
} elseif ('\'' == substr($value, 0, 1) && '\'' == substr($value, -1)) {
370370
$value = strtr($value, array("''" => "'", "'" => ''));
371371
}
372372

library/Zend/Feed/Element.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function __get($var)
193193
if ($length == 1) {
194194
return new Zend_Feed_Element($nodes[0]);
195195
} elseif ($length > 1) {
196-
return array_map(create_function('$e', 'return new Zend_Feed_Element($e);'), $nodes);
196+
return array_map(function ($e) { return new Zend_Feed_Element($e); }, $nodes);
197197
} else {
198198
// When creating anonymous nodes for __set chaining, don't
199199
// call appendChild() on them. Instead we pass the current

library/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static function getAllCapabilities(TeraWurfl $wurflObj)
8888
if (!is_array($group)) {
8989
continue;
9090
}
91-
while (list ($key, $value) = each($group)) {
91+
foreach ($group as $key => $value) {
9292
if (is_bool($value)) {
9393
// to have the same type than the official WURFL API
9494
$features[$key] = ($value ? 'true' : 'false');

0 commit comments

Comments
 (0)