Skip to content

Commit

Permalink
Merge pull request #1 from koala-framework/fix-php-7.2-each-deprecated
Browse files Browse the repository at this point in the history
fix php 7.2 compatibility, each is deprecated
  • Loading branch information
kaufmo authored May 2, 2018
2 parents 2be9b8f + 7af2075 commit c6ef273
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library/Zend/Cache/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(array $options = array())
public function setDirectives($directives)
{
if (!is_array($directives)) Zend_Cache::throwException('Directives parameter must be an array');
while (list($name, $value) = each($directives)) {
foreach ($directives as $name => $value) {
if (!is_string($name)) {
Zend_Cache::throwException("Incorrect option name : $name");
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Config/Yaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ protected static function _decodeYaml($currentIndent, &$lines)
{
$config = array();
$inIndent = false;
while (list($n, $line) = each($lines)) {
foreach ($lines as $n => $line) {
$lineno = $n + 1;

$line = rtrim(preg_replace("/#.*$/", "", $line));
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function getAllCapabilities(TeraWurfl $wurflObj)
if (!is_array($group)) {
continue;
}
while (list ($key, $value) = each($group)) {
foreach ($group as $key => $value) {
if (is_bool($value)) {
// to have the same type than the official WURFL API
$features[$key] = ($value ? 'true' : 'false');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function __construct(array $options = array())
{
$this->_credential = new Zend_Service_DeveloperGarden_Credential();

while (list($name, $value) = each($options)) {
foreach ($options as $name => $value) {
switch (ucfirst($name)) {
case 'Username' :
$this->_credential->setUsername($value);
Expand Down
6 changes: 4 additions & 2 deletions library/Zend/XmlRpc/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,15 @@ protected static function _createSimpleXMLElement(&$xml)
*/
protected static function _extractTypeAndValue(SimpleXMLElement $xml, &$type, &$value)
{
list($type, $value) = each($xml);
$type = key($xml);
$value = current($xml);

if (!$type and $value === null) {
$namespaces = array('ex' => 'http://ws.apache.org/xmlrpc/namespaces/extensions');
foreach ($namespaces as $namespaceName => $namespaceUri) {
$namespaceXml = $xml->children($namespaceUri);
list($type, $value) = each($namespaceXml);
$type = key($namespaceXml);
$value = current($namespaceXml);
if ($type !== null) {
$type = $namespaceName . ':' . $type;
break;
Expand Down

0 comments on commit c6ef273

Please sign in to comment.