diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php index 1c217d9c51d..66003e4122f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php @@ -124,7 +124,7 @@ protected function _buildMenuArray(Varien_Simplexml_Element $parent=null, $path= uasort($parentArr, array($this, '_sortMenu')); - while (list($key, $value) = each($parentArr)) { + foreach ($parentArr as $key => $value) { $last = $key; } if (isset($last)) { diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php index d555738377e..4000ce57c5a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php @@ -718,10 +718,10 @@ public function getOrderOptions($product = null) { $options = parent::getOrderOptions($product); $options['attributes_info'] = $this->getSelectedAttributesInfo($product); - /** @var Mage_Sales_Model_Quote_Item_Option $simpleOption */ + /** @var Mage_Sales_Model_Quote_Item_Option|Mage_Catalog_Model_Product_Configuration_Item_Option $simpleOption */ if ($simpleOption = $this->getProduct($product)->getCustomOption('simple_product')) { - $options['simple_name'] = $simpleOption->getProduct($product)->getName(); - $options['simple_sku'] = $simpleOption->getProduct($product)->getSku(); + $options['simple_name'] = $simpleOption->getProduct()->getName(); + $options['simple_sku'] = $simpleOption->getProduct()->getSku(); } $options['product_calculations'] = self::CALCULATE_PARENT; @@ -784,8 +784,8 @@ public function getWeight($product = null) if ($this->getProduct($product)->hasCustomOptions() && ($simpleProductOption = $this->getProduct($product)->getCustomOption('simple_product')) ) { - /** @var Mage_Sales_Model_Quote_Item_Option $simpleProductOption */ - $simpleProduct = $simpleProductOption->getProduct($product); + /** @var Mage_Sales_Model_Quote_Item_Option|Mage_Catalog_Model_Product_Configuration_Item_Option $simpleProductOption */ + $simpleProduct = $simpleProductOption->getProduct(); if ($simpleProduct) { return $simpleProduct->getWeight(); } @@ -837,10 +837,10 @@ public function getSku($product = null) /** @var Mage_Sales_Model_Quote_Item_Option $simpleOption */ $simpleOption = $this->getProduct($product)->getCustomOption('simple_product'); if ($simpleOption) { - $optionProduct = $simpleOption->getProduct($product); + $optionProduct = $simpleOption->getProduct(); $simpleSku = null; if ($optionProduct) { - $simpleSku = $simpleOption->getProduct($product)->getSku(); + $simpleSku = $simpleOption->getProduct()->getSku(); } $sku = parent::getOptionSku($product, $simpleSku); } else { diff --git a/lib/Mage/Cache/Backend/File.php b/lib/Mage/Cache/Backend/File.php index d21717532a1..dec222271af 100644 --- a/lib/Mage/Cache/Backend/File.php +++ b/lib/Mage/Cache/Backend/File.php @@ -104,7 +104,7 @@ public function __construct(array $options = array()) } // Don't use parent constructor - while (list($name, $value) = each($options)) { + foreach ($options as $name => $value) { $this->setOption($name, $value); } diff --git a/lib/Zend/Config/Yaml.php b/lib/Zend/Config/Yaml.php index 16b46f34a3a..7cfc8d62679 100644 --- a/lib/Zend/Config/Yaml.php +++ b/lib/Zend/Config/Yaml.php @@ -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)); diff --git a/lib/Zend/Feed/Element.php b/lib/Zend/Feed/Element.php index 755e362ae19..4d01d352c73 100644 --- a/lib/Zend/Feed/Element.php +++ b/lib/Zend/Feed/Element.php @@ -193,7 +193,7 @@ public function __get($var) if ($length == 1) { return new Zend_Feed_Element($nodes[0]); } elseif ($length > 1) { - return array_map(create_function('$e', 'return new Zend_Feed_Element($e);'), $nodes); + return array_map(function($e) { return new Zend_Feed_Element($e); }, $nodes); } else { // When creating anonymous nodes for __set chaining, don't // call appendChild() on them. Instead we pass the current diff --git a/lib/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php b/lib/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php index 08ea3ec48a2..07050ebeea9 100644 --- a/lib/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php +++ b/lib/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php @@ -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'); diff --git a/lib/Zend/Xml/Security.php b/lib/Zend/Xml/Security.php index dbcf1ec3fcd..f80da9896b5 100644 --- a/lib/Zend/Xml/Security.php +++ b/lib/Zend/Xml/Security.php @@ -167,10 +167,10 @@ public static function scanFile($file, DOMDocument $dom = null) public static function isPhpFpm() { $isVulnerableVersion = ( - version_compare(PHP_VERSION, '5.5.22', 'lt') + version_compare(PHP_VERSION, '5.5.22', '<') || ( - version_compare(PHP_VERSION, '5.6', 'gte') - && version_compare(PHP_VERSION, '5.6.6', 'lt') + version_compare(PHP_VERSION, '5.6', '>=') + && version_compare(PHP_VERSION, '5.6.6', '<') ) ); diff --git a/lib/Zend/XmlRpc/Value.php b/lib/Zend/XmlRpc/Value.php index 34f0bea6630..88226994079 100644 --- a/lib/Zend/XmlRpc/Value.php +++ b/lib/Zend/XmlRpc/Value.php @@ -486,13 +486,15 @@ protected static function _createSimpleXMLElement(&$xml) */ protected static function _extractTypeAndValue(SimpleXMLElement $xml, &$type, &$value) { - list($type, $value) = each($xml); + $value = reset($xml); + $type = key($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); + $value = reset($namespaceXml); + $type = key($namespaceXml); if ($type !== null) { $type = $namespaceName . ':' . $type; break;