From 8883d36c35631ae8eab04ce0a9deb62311c3dbee Mon Sep 17 00:00:00 2001 From: Serhiy Shkolyarenko Date: Mon, 16 Mar 2015 15:22:26 +0200 Subject: [PATCH 01/22] MAGETWO-34955: [GITHUB]Email message containing non English character is displayed incorrectly on the receiver. #1086 fixed encoding and template processing --- app/code/Magento/Email/Model/Template.php | 14 ++++++++++++-- lib/internal/Magento/Framework/Mail/Message.php | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Email/Model/Template.php b/app/code/Magento/Email/Model/Template.php index 5c305a02a0490..05fb78ff5151b 100644 --- a/app/code/Magento/Email/Model/Template.php +++ b/app/code/Magento/Email/Model/Template.php @@ -319,6 +319,16 @@ public function loadDefault($templateId) $modulesDirectory = $this->_filesystem->getDirectoryRead(DirectoryList::MODULES); $templateText = $modulesDirectory->readFile($modulesDirectory->getRelativePath($templateFile)); + /** + * trim copyright message for text templates + */ + if ('html' != $templateType + && preg_match('/^/m', $templateText, $matches) + && strpos($matches[0], 'Copyright') > 0 + ) { + $templateText = str_replace($matches[0], '', $templateText); + } + if (preg_match('//u', $templateText, $matches)) { $this->setTemplateSubject($matches[1]); $templateText = str_replace($matches[0], '', $templateText); @@ -335,9 +345,9 @@ public function loadDefault($templateId) } /** - * Remove comment lines + * Remove comment lines and extra spaces */ - $templateText = preg_replace('#\{\*.*\*\}#suU', '', $templateText); + $templateText = trim(preg_replace('#\{\*.*\*\}#suU', '', $templateText)); $this->setTemplateText($templateText); $this->setId($templateId); diff --git a/lib/internal/Magento/Framework/Mail/Message.php b/lib/internal/Magento/Framework/Mail/Message.php index e0ff9f434d4f3..d91575c345a2d 100644 --- a/lib/internal/Magento/Framework/Mail/Message.php +++ b/lib/internal/Magento/Framework/Mail/Message.php @@ -9,6 +9,14 @@ class Message extends \Zend_Mail implements MessageInterface { + /** + * @param string $charset + */ + public function __construct($charset = 'utf-8') + { + parent::__construct($charset); + } + /** * Message type * From 7cacce2af71b64e491653c8773db566fc8b9da39 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Tue, 17 Mar 2015 09:20:26 +0200 Subject: [PATCH 02/22] MAGETWO-35155: Error appears on Shipping Method page during MultiAdress Checkout if countries are not allowed for shipping (cherry picked from commit 6cc59f5) --- .../Magento/GiftMessage/Model/Type/Plugin/Multishipping.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/GiftMessage/Model/Type/Plugin/Multishipping.php b/app/code/Magento/GiftMessage/Model/Type/Plugin/Multishipping.php index 95623b5e71bab..ca30141e79a32 100644 --- a/app/code/Magento/GiftMessage/Model/Type/Plugin/Multishipping.php +++ b/app/code/Magento/GiftMessage/Model/Type/Plugin/Multishipping.php @@ -31,13 +31,13 @@ public function __construct( /** * @param \Magento\Multishipping\Model\Checkout\Type\Multishipping $subject - * @param array $methods + * @param array|null $methods * @return $this * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeSetShippingMethods( \Magento\Multishipping\Model\Checkout\Type\Multishipping $subject, - array $methods + $methods ) { $giftMessages = $this->request->getParam('giftmessage'); $quote = $subject->getQuote(); From 3cc6ae46df1e23c36311b935e3b07a2e87718d91 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Tue, 17 Mar 2015 10:03:01 +0200 Subject: [PATCH 03/22] MAGETWO-35155: Error appears on Shipping Method page during MultiAdress Checkout if countries are not allowed for shipping - unit test fix (cherry picked from commit 12c93a5) --- .../Model/Type/Plugin/MultishippingTest.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/GiftMessage/Test/Unit/Model/Type/Plugin/MultishippingTest.php b/app/code/Magento/GiftMessage/Test/Unit/Model/Type/Plugin/MultishippingTest.php index b349b9d54b1f6..d46847b53c4ae 100644 --- a/app/code/Magento/GiftMessage/Test/Unit/Model/Type/Plugin/MultishippingTest.php +++ b/app/code/Magento/GiftMessage/Test/Unit/Model/Type/Plugin/MultishippingTest.php @@ -41,7 +41,11 @@ protected function setUp() ); } - public function testBeforeSetShippingMethods() + /** + * @dataProvider beforeSetShippingMethodsDataProvider + * @param array|null $methods + */ + public function testBeforeSetShippingMethods($methods) { $this->requestMock->expects($this->once()) ->method('getParam') @@ -52,6 +56,17 @@ public function testBeforeSetShippingMethods() $subjectMock->expects($this->once())->method('getQuote')->will($this->returnValue($quoteMock)); $this->messageMock->expects($this->once())->method('add')->with('Expected Value', $quoteMock); - $this->plugin->beforeSetShippingMethods($subjectMock, []); + $this->plugin->beforeSetShippingMethods($subjectMock, $methods); + } + + /** + * @return array + */ + public function beforeSetShippingMethodsDataProvider() + { + return [ + [null], + [[]] + ]; } } From 7c5c08deaae40bc71543ca18857f7b86acb16f3c Mon Sep 17 00:00:00 2001 From: Iryna Savchenko Date: Tue, 17 Mar 2015 18:58:48 +0200 Subject: [PATCH 04/22] MAGETWO-35076: Impossible to place order with DHL EU shipping method --- app/code/Magento/Dhl/Model/Carrier.php | 4 ++-- app/code/Magento/Fedex/Model/Carrier.php | 23 +------------------ .../Model/Carrier/AbstractCarrierOnline.php | 21 +++++++++++++++++ .../Carrier/AbstractCarrierOnlineTest.php | 8 +++++++ app/code/Magento/Usps/Model/Carrier.php | 6 ++--- 5 files changed, 35 insertions(+), 27 deletions(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 64f37e2b674b8..ad74a0c860365 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -1034,7 +1034,7 @@ protected function _parseResponse($response) if (strlen(trim($response)) > 0) { if (strpos(trim($response), 'parseXml($response); if (is_object($xml)) { if (in_array($xml->getName(), ['ErrorResponse', 'ShipmentValidateErrorResponse']) || isset($xml->GetQuoteResponse->Note->Condition) @@ -1775,7 +1775,7 @@ protected function _parseXmlTrackingResponse($trackings, $response) $resultArr = []; if (strlen(trim($response)) > 0) { - $xml = simplexml_load_string($response); + $xml = $this->parseXml($response); if (!is_object($xml)) { $errorTitle = __('Response is in the wrong format'); } diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index f3767390c046a..eb4112ef1ae52 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -706,7 +706,7 @@ protected function _parseXmlResponse($response) $priceArr = []; if (strlen(trim($response)) > 0) { - if ($xml = $this->_parseXml($response)) { + if ($xml = $this->parseXml($response)) { if (is_object($xml->Error) && is_object($xml->Error->Message)) { $errorTitle = (string)$xml->Error->Message; } elseif (is_object($xml->SoftError) && is_object($xml->SoftError->Message)) { @@ -760,27 +760,6 @@ protected function _parseXmlResponse($response) return $result; } - /** - * Parse XML string and return XML document object or false - * - * @param string $xmlContent - * @return \Magento\Shipping\Model\Simplexml\Element|bool - * @throws \Exception - */ - protected function _parseXml($xmlContent) - { - try { - try { - return simplexml_load_string($xmlContent); - } catch (\Exception $e) { - throw new \Exception(__('Failed to parse xml document: %1', $xmlContent)); - } - } catch (\Exception $e) { - $this->_logger->critical($e); - return false; - } - } - /** * Get configuration data of carrier * diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php index 15aca6c8b93b9..a9166a07c709a 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php @@ -607,4 +607,25 @@ public function getMethodPrice($cost, $method = '') $cost ); } + + /** + * Parse XML string and return XML document object or false + * + * @param string $xmlContent + * @return \Magento\Shipping\Model\Simplexml\Element|bool + * @throws \Exception + */ + public function parseXml($xmlContent) + { + try { + try { + return simplexml_load_string($xmlContent); + } catch (\Exception $e) { + throw new \Exception(__('Failed to parse xml document: %1', $xmlContent)); + } + } catch (\Exception $e) { + $this->_logger->critical($e); + return false; + } + } } diff --git a/app/code/Magento/Shipping/Test/Unit/Model/Carrier/AbstractCarrierOnlineTest.php b/app/code/Magento/Shipping/Test/Unit/Model/Carrier/AbstractCarrierOnlineTest.php index d2f63918def30..6dc448aaf79ce 100644 --- a/app/code/Magento/Shipping/Test/Unit/Model/Carrier/AbstractCarrierOnlineTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Model/Carrier/AbstractCarrierOnlineTest.php @@ -104,4 +104,12 @@ public function testComposePackages() $this->carrier->proccessAdditionalValidation($request); } + + public function testParseXml() + { + $xmlString = "42>"; + $simpleXmlElement = $this->carrier->parseXml($xmlString); + $this->assertEquals('GetResponse', $simpleXmlElement->getName()); + $this->assertEquals(42, (int)$simpleXmlElement->value); + } } diff --git a/app/code/Magento/Usps/Model/Carrier.php b/app/code/Magento/Usps/Model/Carrier.php index efccb26521a63..49976c39fef46 100644 --- a/app/code/Magento/Usps/Model/Carrier.php +++ b/app/code/Magento/Usps/Model/Carrier.php @@ -512,7 +512,7 @@ protected function _parseXmlResponse($response) $response ); } - $xml = simplexml_load_string($response); + $xml = $this->parseXml($response); if (is_object($xml)) { $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); @@ -1042,7 +1042,7 @@ protected function _parseXmlTrackingResponse($trackingvalue, $response) $resultArr = []; if (strlen(trim($response)) > 0) { if (strpos(trim($response), 'parseXml($response); if (is_object($xml)) { if (isset($xml->Number) && isset($xml->Description) && (string)$xml->Description != '') { $errorTitle = (string)$xml->Description; @@ -1869,7 +1869,7 @@ protected function _doShipmentRequest(\Magento\Framework\Object $request) $client->setParameterGet('XML', $requestXml); $response = $client->request()->getBody(); - $response = simplexml_load_string($response); + $response = $this->parseXml($response); if ($response === false || $response->getName() == 'Error') { $debugData['result'] = [ 'error' => $response->Description, From a7ecede61148f80c5bebf01fe89d9f735c590985 Mon Sep 17 00:00:00 2001 From: Maxim Medinskiy Date: Tue, 17 Mar 2015 19:04:37 +0200 Subject: [PATCH 05/22] MAGETWO-35026: JS error on all pages if bundling and minification for js files enabled --- .../frontend/templates/form/register.phtml | 2 +- .../RequireJs/Block/Html/Head/Config.php | 27 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml index c792446894428..934a7481cb65a 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml @@ -164,7 +164,7 @@ require([ 'jquery', 'mage/mage' -], function(jQuery){ +], function($){ var dataForm = $('#form-validate'); var ignore = isEnabled() ? '\'input[id$="full"]\'' : 'null'; ?>; diff --git a/app/code/Magento/RequireJs/Block/Html/Head/Config.php b/app/code/Magento/RequireJs/Block/Html/Head/Config.php index 4f06884dfe81d..92dee1fea49fd 100644 --- a/app/code/Magento/RequireJs/Block/Html/Head/Config.php +++ b/app/code/Magento/RequireJs/Block/Html/Head/Config.php @@ -6,13 +6,15 @@ namespace Magento\RequireJs\Block\Html\Head; +use Magento\Framework\RequireJs\Config as RequireJsConfig; + /** * Block responsible for including RequireJs config on the page */ class Config extends \Magento\Framework\View\Element\AbstractBlock { /** - * @var \Magento\Framework\RequireJs\Config + * @var RequireJsConfig */ private $config; @@ -28,7 +30,7 @@ class Config extends \Magento\Framework\View\Element\AbstractBlock /** * @param \Magento\Framework\View\Element\Context $context - * @param \Magento\Framework\RequireJs\Config $config + * @param RequireJsConfig $config * @param \Magento\RequireJs\Model\FileManager $fileManager * @param \Magento\Framework\View\Page\Config $pageConfig * @param \Magento\Framework\View\Asset\ConfigInterface $bundleConfig @@ -36,7 +38,7 @@ class Config extends \Magento\Framework\View\Element\AbstractBlock */ public function __construct( \Magento\Framework\View\Element\Context $context, - \Magento\Framework\RequireJs\Config $config, + RequireJsConfig $config, \Magento\RequireJs\Model\FileManager $fileManager, \Magento\Framework\View\Page\Config $pageConfig, \Magento\Framework\View\Asset\ConfigInterface $bundleConfig, @@ -59,28 +61,25 @@ protected function _prepareLayout() $requireJsConfig = $this->fileManager->createRequireJsConfigAsset(); $assetCollection = $this->pageConfig->getAssetCollection(); - if ($this->bundleConfig->isBundlingJsFiles()) { - $after = \Magento\Framework\RequireJs\Config::REQUIRE_JS_FILE_NAME; + $assetCollection->insert( + $requireJsConfig->getFilePath(), + $requireJsConfig, + RequireJsConfig::REQUIRE_JS_FILE_NAME + ); + if ($this->bundleConfig->isBundlingJsFiles()) { $bundleAssets = $this->fileManager->createBundleJsPool(); $staticAsset = $this->fileManager->createStaticJsAsset(); /** @var \Magento\Framework\View\Asset\File $bundleAsset */ if (!empty($bundleAssets) && $staticAsset !== false) { foreach ($bundleAssets as $bundleAsset) { - $assetCollection->insert($bundleAsset->getFilePath(), $bundleAsset, $after); - $after = $bundleAsset->getFilePath(); + $assetCollection->insert($bundleAsset->getFilePath(), $bundleAsset, RequireJsConfig::REQUIRE_JS_FILE_NAME); } - $assetCollection->insert($staticAsset->getFilePath(), $staticAsset, $after); + $assetCollection->insert($staticAsset->getFilePath(), $staticAsset, RequireJsConfig::CONFIG_FILE_NAME); } } - $assetCollection->insert( - $requireJsConfig->getFilePath(), - $requireJsConfig, - \Magento\Framework\RequireJs\Config::REQUIRE_JS_FILE_NAME - ); - return parent::_prepareLayout(); } From 0b035d9bd2cd1cb6dad24b1101b3b6704897f8aa Mon Sep 17 00:00:00 2001 From: Maxim Medinskiy Date: Tue, 17 Mar 2015 19:10:56 +0200 Subject: [PATCH 06/22] MAGETWO-35026: JS error on all pages if bundling and minification for js files enabled - fixed static tests --- app/code/Magento/RequireJs/Block/Html/Head/Config.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/RequireJs/Block/Html/Head/Config.php b/app/code/Magento/RequireJs/Block/Html/Head/Config.php index 92dee1fea49fd..ea71c5459f9df 100644 --- a/app/code/Magento/RequireJs/Block/Html/Head/Config.php +++ b/app/code/Magento/RequireJs/Block/Html/Head/Config.php @@ -74,7 +74,11 @@ protected function _prepareLayout() /** @var \Magento\Framework\View\Asset\File $bundleAsset */ if (!empty($bundleAssets) && $staticAsset !== false) { foreach ($bundleAssets as $bundleAsset) { - $assetCollection->insert($bundleAsset->getFilePath(), $bundleAsset, RequireJsConfig::REQUIRE_JS_FILE_NAME); + $assetCollection->insert( + $bundleAsset->getFilePath(), + $bundleAsset, + RequireJsConfig::REQUIRE_JS_FILE_NAME + ); } $assetCollection->insert($staticAsset->getFilePath(), $staticAsset, RequireJsConfig::CONFIG_FILE_NAME); } From 2f5bacaf0d3147352b6b297431e8aa12a4f9017b Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Tue, 17 Mar 2015 19:11:31 +0200 Subject: [PATCH 07/22] MAGETWO-35230: Time custom option in cart is different from specified on product page --- .../Block/Widget/Grid/Column/Filter/Date.php | 3 ++- app/code/Magento/Backup/Model/Backup.php | 2 +- .../Model/Product/Option/Type/Date.php | 19 +++++++++++-------- .../Model/Import/Product.php | 2 +- .../Magento/CatalogRule/Model/Observer.php | 2 +- .../Model/Import/Address.php | 2 +- .../Model/Import/Customer.php | 6 +++--- .../Entity/Attribute/Backend/Datetime.php | 2 +- .../Magento/Reports/Block/Adminhtml/Grid.php | 2 +- 9 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php index 5675f0fcbdadf..f2def2a456fc5 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php @@ -205,7 +205,8 @@ protected function _convertDate($date) \IntlDateFormatter::NONE, $adminTimeZone ); - $simpleRes = new \DateTime('@' . $formatter->parse($date), $adminTimeZone); + $simpleRes = new \DateTime(null, $adminTimeZone); + $simpleRes->setTimestamp($formatter->parse($date)); $simpleRes->setTime(0, 0, 0); $simpleRes->setTimezone(new \DateTimeZone('UTC')); return $simpleRes; diff --git a/app/code/Magento/Backup/Model/Backup.php b/app/code/Magento/Backup/Model/Backup.php index a0d44f44641b9..9ff789349dea4 100755 --- a/app/code/Magento/Backup/Model/Backup.php +++ b/app/code/Magento/Backup/Model/Backup.php @@ -152,7 +152,7 @@ public function load($fileName, $filePath) 'extension' => $this->_helper->getExtensionByType($backupData->getType()), 'display_name' => $this->_helper->nameToDisplayName($backupData->getName()), 'name' => $backupData->getName(), - 'date_object' => new \DateTime('@' . $backupData->getTime()), + 'date_object' => (new \DateTime())->setTimestamp($backupData->getTime()), ] ); diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php index 9d4c877d8da83..e34493d509513 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php @@ -165,7 +165,7 @@ public function prepareForCart() $timestamp += 60 * 60 * $value['hour'] + 60 * $value['minute']; } - $date = new \DateTime('@' . $timestamp); + $date = (new \DateTime())->setTimestamp($timestamp); $result = $date->format('Y-m-d H:i:s'); // Save date in internal format to avoid locale date bugs @@ -188,19 +188,22 @@ public function getFormattedOptionValue($optionValue) { if ($this->_formattedOptionValue === null) { if ($this->getOption()->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_DATE) { - $format = $this->_localeDate->getDateFormat( - \IntlDateFormatter::MEDIUM + $result = $this->_localeDate->formatDateTime( + new \DateTime($optionValue), + \IntlDateFormatter::MEDIUM, + \IntlDateFormatter::NONE ); - $result = \IntlDateFormatter::formatObject(new \DateTime($optionValue), $format); } elseif ($this->getOption()->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_DATE_TIME) { - $format = $this->_localeDate->getDateTimeFormat( + $result = $this->_localeDate->formatDateTime( + new \DateTime($optionValue), + \IntlDateFormatter::SHORT, \IntlDateFormatter::SHORT ); - $result = \IntlDateFormatter::formatObject(new \DateTime($optionValue), $format); } elseif ($this->getOption()->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_TIME) { - $result = \IntlDateFormatter::formatObject( + $result = $this->_localeDate->formatDateTime( new \DateTime($optionValue), - $this->is24hTimeFormat() ? 'H:i' : 'h:i a' + \IntlDateFormatter::NONE, + \IntlDateFormatter::SHORT ); } else { $result = $optionValue; diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index e8bba488c9612..97eb4ce5fbeff 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1086,7 +1086,7 @@ protected function _saveProducts() $storeIds = [0]; if ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) { - $attrValue = new \DateTime('@' . strtotime($attrValue)); + $attrValue = (new \DateTime())->setTimestamp(strtotime($attrValue)); $attrValue = $attrValue->format(DateTime::DATETIME_PHP_FORMAT); } elseif ($backModel) { $attribute->getBackend()->beforeSave($product); diff --git a/app/code/Magento/CatalogRule/Model/Observer.php b/app/code/Magento/CatalogRule/Model/Observer.php index b5cf25c153b3a..bcd53b7271939 100644 --- a/app/code/Magento/CatalogRule/Model/Observer.php +++ b/app/code/Magento/CatalogRule/Model/Observer.php @@ -267,7 +267,7 @@ public function prepareCatalogProductCollectionPrices(EventObserver $observer) if ($observer->getEvent()->hasDate()) { $date = new \DateTime($observer->getEvent()->getDate()); } else { - $date = new \DateTime('@' . $this->_localeDate->scopeTimeStamp($store)); + $date = (new \DateTime())->setTimestamp($this->_localeDate->scopeTimeStamp($store)); } $productIds = []; diff --git a/app/code/Magento/CustomerImportExport/Model/Import/Address.php b/app/code/Magento/CustomerImportExport/Model/Import/Address.php index eb7a35225b27b..a5a37a7e363fd 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/Address.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/Address.php @@ -473,7 +473,7 @@ protected function _prepareDataForUpdate(array $rowData) if ('select' == $attributeParams['type']) { $value = $attributeParams['options'][strtolower($rowData[$attributeAlias])]; } elseif ('datetime' == $attributeParams['type']) { - $value = new \DateTime('@' . strtotime($rowData[$attributeAlias])); + $value = (new \DateTime())->setTimestamp(strtotime($rowData[$attributeAlias])); $value = $value->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT); } else { $value = $rowData[$attributeAlias]; diff --git a/app/code/Magento/CustomerImportExport/Model/Import/Customer.php b/app/code/Magento/CustomerImportExport/Model/Import/Customer.php index 0b37b5762f167..0608f206fa029 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/Customer.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/Customer.php @@ -292,11 +292,11 @@ protected function _prepareDataForUpdate(array $rowData) $attributesToSave = []; // entity table data - $now = new \DateTime('@' . time()); + $now = new \DateTime(); if (empty($rowData['created_at'])) { $createdAt = $now; } else { - $createdAt = new \DateTime('@' . strtotime($rowData['created_at'])); + $createdAt = (new \DateTime())->setTimestamp(strtotime($rowData['created_at'])); } $entityRow = [ 'group_id' => empty($rowData['group_id']) ? self::DEFAULT_GROUP_ID : $rowData['group_id'], @@ -333,7 +333,7 @@ protected function _prepareDataForUpdate(array $rowData) if ('select' == $attributeParameters['type']) { $value = $attributeParameters['options'][strtolower($value)]; } elseif ('datetime' == $attributeParameters['type']) { - $value = new \DateTime('@' . strtotime($value)); + $value = (new \DateTime())->setTimestamp(strtotime($value)); $value = $value->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT); } elseif ($backendModel) { $attribute->getBackend()->beforeSave($this->_customerModel->setData($attributeCode, $value)); diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php b/app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php index 464d03acab2f9..4145ac0a68cd9 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php @@ -71,7 +71,7 @@ public function formatDate($date) } // unix timestamp given - simply instantiate date object if (is_scalar($date) && preg_match('/^[0-9]+$/', $date)) { - $date = new \DateTime('@' . $date); + $date = (new \DateTime())->setTimestamp($date); // international format } elseif (!($date instanceof \DateTime)) { $date = new \DateTime($date); diff --git a/app/code/Magento/Reports/Block/Adminhtml/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Grid.php index 5a09854e7c076..ddb112cd99363 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Grid.php @@ -92,7 +92,7 @@ protected function _prepareCollection() if (!isset($data['report_from'])) { // getting all reports from 2001 year - $date = new \DateTime('@' . mktime(0, 0, 0, 1, 1, 2001)); + $date = (new \DateTime())->setTimestamp(mktime(0, 0, 0, 1, 1, 2001)); $data['report_from'] = $this->_localeDate->formatDateTime( $date, \IntlDateFormatter::SHORT, From 46cf26be97d394d41cc1845a4fef1dc402629ce2 Mon Sep 17 00:00:00 2001 From: Iryna Savchenko Date: Tue, 17 Mar 2015 19:38:20 +0200 Subject: [PATCH 08/22] MAGETWO-35076: Impossible to place order with DHL EU shipping method - CR Changes --- app/code/Magento/Fedex/Model/Carrier.php | 3 ++- .../Shipping/Model/Carrier/AbstractCarrierOnline.php | 12 +----------- .../Magento/Test/Legacy/_files/obsolete_methods.php | 1 + 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index eb4112ef1ae52..278ba7d51e8a7 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -706,7 +706,8 @@ protected function _parseXmlResponse($response) $priceArr = []; if (strlen(trim($response)) > 0) { - if ($xml = $this->parseXml($response)) { + $xml = $this->parseXml($response); + if (is_object($xml)) { if (is_object($xml->Error) && is_object($xml->Error->Message)) { $errorTitle = (string)$xml->Error->Message; } elseif (is_object($xml->SoftError) && is_object($xml->SoftError->Message)) { diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php index a9166a07c709a..03fdb428d9461 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php @@ -613,19 +613,9 @@ public function getMethodPrice($cost, $method = '') * * @param string $xmlContent * @return \Magento\Shipping\Model\Simplexml\Element|bool - * @throws \Exception */ public function parseXml($xmlContent) { - try { - try { - return simplexml_load_string($xmlContent); - } catch (\Exception $e) { - throw new \Exception(__('Failed to parse xml document: %1', $xmlContent)); - } - } catch (\Exception $e) { - $this->_logger->critical($e); - return false; - } + return simplexml_load_string($xmlContent, 'Magento\Shipping\Model\Simplexml\Element'); } } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index 6b515c3cd676d..d01d17f39f125 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -157,6 +157,7 @@ ['_parseDescription', 'Magento\Sales\Model\Order\Pdf\Items\AbstractItems'], ['_parsePackageTheme', 'Magento\Widget\Model\Widget\Instance'], ['_parseXmlTrackingResponse', 'Magento\Fedex\Model\Carrier'], + ['_parseXml', 'Magento\Fedex\Model\Carrier'], ['_prepareCondition', 'Magento\CatalogSearch\Model\Advanced'], ['_prepareConfigurableProductData', 'Magento\CatalogImportExport\Model\Export\Product'], ['_prepareConfigurableProductPrice', 'Magento\CatalogImportExport\Model\Export\Product'], From 6d338c5195ce61c64ddbd3a5c04b1b4b4893a95c Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Wed, 18 Mar 2015 11:30:14 +0200 Subject: [PATCH 09/22] MAGETWO-32710: Code micro-optimizations - PHPCS sniff --- .../Sniffs/MicroOptimizations/IsNullSniff.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 dev/tests/static/framework/Magento/Sniffs/MicroOptimizations/IsNullSniff.php diff --git a/dev/tests/static/framework/Magento/Sniffs/MicroOptimizations/IsNullSniff.php b/dev/tests/static/framework/Magento/Sniffs/MicroOptimizations/IsNullSniff.php new file mode 100644 index 0000000000000..62819a33fa150 --- /dev/null +++ b/dev/tests/static/framework/Magento/Sniffs/MicroOptimizations/IsNullSniff.php @@ -0,0 +1,36 @@ +getTokens(); + if ($tokens[$stackPtr]['content'] === $this->blacklist) { + $sourceFile->addError("is_null should be avoided. Use strict comparison instead.", $stackPtr); + } + } +} From 1506ae46026ae41d421d9db2853ec5123a35e365 Mon Sep 17 00:00:00 2001 From: Iryna Savchenko Date: Wed, 18 Mar 2015 11:59:06 +0200 Subject: [PATCH 10/22] MAGETWO-35076: Impossible to place order with DHL EU shipping method - CR Changes --- app/code/Magento/Dhl/Model/Carrier.php | 4 ++-- app/code/Magento/Fedex/Model/Carrier.php | 2 +- .../Shipping/Model/Carrier/AbstractCarrierOnline.php | 8 +++++--- .../Test/Unit/Model/Carrier/AbstractCarrierOnlineTest.php | 3 +++ app/code/Magento/Usps/Model/Carrier.php | 6 +++--- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index ad74a0c860365..6d5c1720a2ce7 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -1034,7 +1034,7 @@ protected function _parseResponse($response) if (strlen(trim($response)) > 0) { if (strpos(trim($response), 'parseXml($response); + $xml = $this->parseXml($response, 'Magento\Shipping\Model\Simplexml\Element'); if (is_object($xml)) { if (in_array($xml->getName(), ['ErrorResponse', 'ShipmentValidateErrorResponse']) || isset($xml->GetQuoteResponse->Note->Condition) @@ -1775,7 +1775,7 @@ protected function _parseXmlTrackingResponse($trackings, $response) $resultArr = []; if (strlen(trim($response)) > 0) { - $xml = $this->parseXml($response); + $xml = $this->parseXml($response, 'Magento\Shipping\Model\Simplexml\Element'); if (!is_object($xml)) { $errorTitle = __('Response is in the wrong format'); } diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 278ba7d51e8a7..51ac852ac050d 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -706,7 +706,7 @@ protected function _parseXmlResponse($response) $priceArr = []; if (strlen(trim($response)) > 0) { - $xml = $this->parseXml($response); + $xml = $this->parseXml($response, 'Magento\Shipping\Model\Simplexml\Element'); if (is_object($xml)) { if (is_object($xml->Error) && is_object($xml->Error->Message)) { $errorTitle = (string)$xml->Error->Message; diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php index 03fdb428d9461..e4f38e73beec0 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php @@ -612,10 +612,12 @@ public function getMethodPrice($cost, $method = '') * Parse XML string and return XML document object or false * * @param string $xmlContent - * @return \Magento\Shipping\Model\Simplexml\Element|bool + * @param string $customSimplexml + * + * @return \SimpleXMLElement|bool */ - public function parseXml($xmlContent) + public function parseXml($xmlContent, $customSimplexml = 'SimpleXMLElement') { - return simplexml_load_string($xmlContent, 'Magento\Shipping\Model\Simplexml\Element'); + return simplexml_load_string($xmlContent, $customSimplexml); } } diff --git a/app/code/Magento/Shipping/Test/Unit/Model/Carrier/AbstractCarrierOnlineTest.php b/app/code/Magento/Shipping/Test/Unit/Model/Carrier/AbstractCarrierOnlineTest.php index 6dc448aaf79ce..8d23a6c29774b 100644 --- a/app/code/Magento/Shipping/Test/Unit/Model/Carrier/AbstractCarrierOnlineTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Model/Carrier/AbstractCarrierOnlineTest.php @@ -111,5 +111,8 @@ public function testParseXml() $simpleXmlElement = $this->carrier->parseXml($xmlString); $this->assertEquals('GetResponse', $simpleXmlElement->getName()); $this->assertEquals(42, (int)$simpleXmlElement->value); + $this->assertInstanceOf('SimpleXMLElement', $simpleXmlElement); + $customSimpleXmlElement = $this->carrier->parseXml($xmlString, 'Magento\Shipping\Model\Simplexml\Element'); + $this->assertInstanceOf('Magento\Shipping\Model\Simplexml\Element', $customSimpleXmlElement); } } diff --git a/app/code/Magento/Usps/Model/Carrier.php b/app/code/Magento/Usps/Model/Carrier.php index 49976c39fef46..9aec05a01125c 100644 --- a/app/code/Magento/Usps/Model/Carrier.php +++ b/app/code/Magento/Usps/Model/Carrier.php @@ -512,7 +512,7 @@ protected function _parseXmlResponse($response) $response ); } - $xml = $this->parseXml($response); + $xml = $this->parseXml($response, 'Magento\Shipping\Model\Simplexml\Element'); if (is_object($xml)) { $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); @@ -1042,7 +1042,7 @@ protected function _parseXmlTrackingResponse($trackingvalue, $response) $resultArr = []; if (strlen(trim($response)) > 0) { if (strpos(trim($response), 'parseXml($response); + $xml = $this->parseXml($response, 'Magento\Shipping\Model\Simplexml\Element'); if (is_object($xml)) { if (isset($xml->Number) && isset($xml->Description) && (string)$xml->Description != '') { $errorTitle = (string)$xml->Description; @@ -1869,7 +1869,7 @@ protected function _doShipmentRequest(\Magento\Framework\Object $request) $client->setParameterGet('XML', $requestXml); $response = $client->request()->getBody(); - $response = $this->parseXml($response); + $response = $this->parseXml($response, 'Magento\Shipping\Model\Simplexml\Element'); if ($response === false || $response->getName() == 'Error') { $debugData['result'] = [ 'error' => $response->Description, From f555e5b3ca658cf4c17daa7393cc46430aa0f786 Mon Sep 17 00:00:00 2001 From: Iryna Savchenko Date: Wed, 18 Mar 2015 12:03:56 +0200 Subject: [PATCH 11/22] MAGETWO-35076: Impossible to place order with DHL EU shipping method - CR Changes --- app/code/Magento/Usps/Model/Carrier.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Usps/Model/Carrier.php b/app/code/Magento/Usps/Model/Carrier.php index 9aec05a01125c..49976c39fef46 100644 --- a/app/code/Magento/Usps/Model/Carrier.php +++ b/app/code/Magento/Usps/Model/Carrier.php @@ -512,7 +512,7 @@ protected function _parseXmlResponse($response) $response ); } - $xml = $this->parseXml($response, 'Magento\Shipping\Model\Simplexml\Element'); + $xml = $this->parseXml($response); if (is_object($xml)) { $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); @@ -1042,7 +1042,7 @@ protected function _parseXmlTrackingResponse($trackingvalue, $response) $resultArr = []; if (strlen(trim($response)) > 0) { if (strpos(trim($response), 'parseXml($response, 'Magento\Shipping\Model\Simplexml\Element'); + $xml = $this->parseXml($response); if (is_object($xml)) { if (isset($xml->Number) && isset($xml->Description) && (string)$xml->Description != '') { $errorTitle = (string)$xml->Description; @@ -1869,7 +1869,7 @@ protected function _doShipmentRequest(\Magento\Framework\Object $request) $client->setParameterGet('XML', $requestXml); $response = $client->request()->getBody(); - $response = $this->parseXml($response, 'Magento\Shipping\Model\Simplexml\Element'); + $response = $this->parseXml($response); if ($response === false || $response->getName() == 'Error') { $debugData['result'] = [ 'error' => $response->Description, From 1289e4e08fbf8c5f84a069e2a183595fcd14276f Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Wed, 18 Mar 2015 12:19:51 +0200 Subject: [PATCH 12/22] MAGETWO-32710: Code micro-optimizations --- .../Magento/AdminNotification/Model/Feed.php | 2 +- .../Magento/AdminNotification/Model/Inbox.php | 2 +- .../Model/CompositeUserContext.php | 6 ++--- .../Unit/Model/CompositeUserContextTest.php | 2 +- .../Magento/Backend/App/AbstractAction.php | 2 +- .../Magento/Backend/Block/Dashboard/Bar.php | 2 +- .../Magento/Backend/Block/Dashboard/Graph.php | 2 +- .../Magento/Backend/Block/Store/Switcher.php | 2 +- .../Backend/Block/Widget/Grid/Column.php | 6 ++--- .../Block/Widget/Grid/Column/Filter/Price.php | 6 ++--- .../Widget/Grid/Column/Filter/Select.php | 4 ++-- .../Block/Widget/Grid/Column/Filter/Store.php | 2 +- .../Block/Widget/Grid/Column/Filter/Theme.php | 4 ++-- .../Widget/Grid/Column/Renderer/Checkbox.php | 2 +- .../Widget/Grid/Column/Renderer/Date.php | 2 +- .../Widget/Grid/Column/Renderer/Number.php | 2 +- .../Widget/Grid/Column/Renderer/Radio.php | 2 +- .../Widget/Grid/Column/Renderer/Select.php | 2 +- .../Widget/Grid/Column/Renderer/Store.php | 4 ++-- .../Widget/Grid/Column/Renderer/Text.php | 4 ++-- .../Backend/Block/Widget/Grid/Container.php | 4 ++-- .../Backend/Block/Widget/Grid/Extended.php | 2 +- .../Magento/Backend/Block/Widget/Tabs.php | 8 +++---- .../Helper/Dashboard/AbstractDashboard.php | 2 +- app/code/Magento/Backend/Helper/Data.php | 2 +- app/code/Magento/Backend/Model/Auth.php | 2 +- .../Magento/Backend/Model/Auth/Session.php | 4 ++-- app/code/Magento/Backend/Model/Menu.php | 4 ++-- .../Model/Menu/Builder/AbstractCommand.php | 6 ++--- .../Backend/Model/Menu/Item/Validator.php | 10 ++++----- .../Magento/Backend/Model/Session/Quote.php | 4 ++-- app/code/Magento/Backend/Model/Url.php | 4 ++-- app/code/Magento/Backup/Model/Backup.php | 6 ++--- app/code/Magento/Bundle/Model/Observer.php | 4 ++-- .../Magento/Bundle/Model/OptionRepository.php | 2 +- .../Bundle/Model/Product/OptionList.php | 2 +- .../Magento/Bundle/Model/Product/Price.php | 18 +++++++-------- .../Bundle/Model/Resource/Indexer/Price.php | 2 +- .../Bundle/Model/Resource/Indexer/Stock.php | 4 ++-- .../Model/Resource/Option/Collection.php | 2 +- .../Pricing/Price/DiscountCalculator.php | 2 +- .../Adminhtml/Category/AbstractCategory.php | 8 +++---- .../Block/Adminhtml/Category/Tab/Product.php | 2 +- .../Adminhtml/Product/Attribute/Set/Main.php | 2 +- .../Product/Edit/Tab/Attributes/Create.php | 2 +- .../Edit/Tab/Price/Group/AbstractGroup.php | 2 +- .../Block/Adminhtml/Product/Edit/Tabs.php | 2 +- .../Catalog/Block/Product/AbstractProduct.php | 2 +- .../Block/Product/Compare/ListCompare.php | 4 ++-- .../Catalog/Block/Product/ListProduct.php | 2 +- .../Block/Product/ProductList/Promotion.php | 2 +- .../Block/Product/ProductList/Random.php | 2 +- .../Block/Product/View/AbstractView.php | 2 +- .../Catalog/Block/Product/View/Additional.php | 2 +- .../Product/View/Options/AbstractOptions.php | 2 +- .../Block/Product/View/Options/Type/Date.php | 4 ++-- .../Controller/Adminhtml/Product/Set/Save.php | 2 +- app/code/Magento/Catalog/Helper/Data.php | 4 ++-- app/code/Magento/Catalog/Helper/Product.php | 2 +- .../Helper/Product/Edit/Action/Attribute.php | 4 ++-- .../Magento/Catalog/Model/AbstractModel.php | 2 +- app/code/Magento/Catalog/Model/Category.php | 4 ++-- .../Category/Attribute/Source/Sortby.php | 2 +- .../Magento/Catalog/Model/Category/Tree.php | 4 ++-- .../Catalog/Model/CategoryManagement.php | 4 ++-- .../Indexer/Product/Eav/AbstractAction.php | 4 ++-- .../Indexer/Product/Price/AbstractAction.php | 4 ++-- app/code/Magento/Catalog/Model/Layer.php | 4 ++-- .../Model/Layer/Filter/AbstractFilter.php | 10 ++++----- .../Layer/Filter/DataProvider/Category.php | 6 ++--- .../Layer/Filter/DataProvider/Decimal.php | 6 ++--- .../Model/Layer/Filter/DataProvider/Price.php | 4 ++-- .../Magento/Catalog/Model/Layer/State.php | 2 +- app/code/Magento/Catalog/Model/Product.php | 4 ++-- .../Model/Product/Attribute/Backend/Media.php | 6 ++--- .../Product/Gallery/GalleryManagement.php | 6 ++--- .../Magento/Catalog/Model/Product/Image.php | 4 ++-- .../Magento/Catalog/Model/Product/Link.php | 8 +++---- .../Model/Product/Option/Repository.php | 4 ++-- .../Product/Option/Type/File/Validator.php | 2 +- .../Option/Type/File/ValidatorFile.php | 2 +- .../Catalog/Model/Product/PriceModifier.php | 4 ++-- .../Magento/Catalog/Model/Product/Type.php | 6 ++--- .../Catalog/Model/Product/Type/Price.php | 18 +++++++-------- .../Magento/Catalog/Model/ProductTypeList.php | 2 +- .../Catalog/Model/Resource/Category.php | 2 +- .../Model/Resource/Category/Collection.php | 2 +- .../Catalog/Model/Resource/Category/Flat.php | 4 ++-- .../Catalog/Model/Resource/Category/Tree.php | 6 ++--- .../Collection/AbstractCollection.php | 2 +- .../Model/Resource/Layer/Filter/Price.php | 14 ++++++------ .../Backend/GroupPrice/AbstractGroupPrice.php | 6 ++--- .../Product/Compare/Item/Collection.php | 2 +- .../Product/Indexer/AbstractIndexer.php | 6 ++--- .../Product/Indexer/Eav/AbstractEav.php | 2 +- .../Resource/Product/Indexer/Eav/Decimal.php | 4 ++-- .../Resource/Product/Indexer/Eav/Source.php | 8 +++---- .../Product/Indexer/Price/DefaultPrice.php | 4 ++-- .../Catalog/Pricing/Price/GroupPrice.php | 2 +- .../Catalog/Pricing/Price/SpecialPrice.php | 4 ++-- .../Model/Export/Product.php | 4 ++-- .../Import/Product/CategoryProcessor.php | 2 +- .../Model/Import/Product/SkuProcessor.php | 2 +- .../Import/Product/Validator/Category.php | 2 +- .../Product/Validator/SuperProductsSku.php | 5 ++--- .../Model/Import/Uploader.php | 2 +- .../Model/Import/Product/Type/OptionTest.php | 2 +- .../Adminhtml/Form/Field/Customergroup.php | 4 ++-- .../Magento/CatalogInventory/Helper/Stock.php | 2 +- .../Model/Indexer/Stock/AbstractAction.php | 2 +- .../CatalogInventory/Model/Observer.php | 2 +- .../QuantityValidator/Initializer/Option.php | 6 ++--- .../Initializer/StockItem.php | 10 ++++----- .../Resource/Indexer/Stock/DefaultStock.php | 4 ++-- .../CatalogInventory/Model/StockState.php | 14 ++++++------ .../Model/Indexer/IndexBuilder.php | 2 +- .../Magento/CatalogRule/Model/Observer.php | 2 +- app/code/Magento/CatalogRule/Model/Rule.php | 2 +- .../Model/Rule/Condition/Product.php | 2 +- .../CatalogSearch/Block/Advanced/Form.php | 6 ++--- .../Magento/CatalogSearch/Model/Advanced.php | 4 ++-- .../Model/Indexer/Fulltext/Action/Full.php | 8 +++---- .../Model/Layer/Filter/Price.php | 2 +- .../CatalogSearch/Model/Resource/Engine.php | 4 ++-- .../Model/Category/Plugin/Store/View.php | 2 +- .../Model/ProductUrlPathGenerator.php | 2 +- app/code/Magento/Centinel/Model/State/Jcb.php | 2 +- .../Centinel/Model/State/Mastercard.php | 2 +- .../Magento/Centinel/Model/State/Visa.php | 2 +- app/code/Magento/Checkout/Block/Cart.php | 2 +- .../Checkout/Block/Cart/AbstractCart.php | 2 +- .../Magento/Checkout/Block/Cart/Crosssell.php | 4 ++-- .../Magento/Checkout/Block/Cart/Totals.php | 4 ++-- .../Block/Onepage/AbstractOnepage.php | 2 +- .../Checkout/Block/Onepage/Billing.php | 2 +- .../Checkout/Block/Onepage/Shipping.php | 2 +- app/code/Magento/Checkout/Model/Cart.php | 6 ++--- app/code/Magento/Checkout/Model/Session.php | 6 ++--- .../Test/Unit/Helper/ExpressRedirectTest.php | 5 ++--- app/code/Magento/Cms/Helper/Page.php | 4 ++-- app/code/Magento/Cms/Model/Page.php | 2 +- app/code/Magento/Cms/Model/Resource/Block.php | 2 +- .../Config/Block/System/Config/Form.php | 6 ++--- app/code/Magento/Config/Model/Config.php | 10 ++++----- .../Model/Config/Backend/Admin/Observer.php | 2 +- .../Model/Config/Source/Email/Identity.php | 2 +- .../Config/Structure/Mapper/ExtendsMapper.php | 2 +- .../Composite/Fieldset/Configurable.php | 2 +- .../Model/ConfigurableProductManagement.php | 2 +- .../Model/OptionRepository.php | 2 +- .../Product/Type/Configurable/Attribute.php | 4 ++-- .../Model/Product/Type/Configurable/Price.php | 2 +- .../Resource/Indexer/Stock/Configurable.php | 2 +- .../Customer/Block/Account/Dashboard.php | 2 +- .../Block/Account/Dashboard/Newsletter.php | 2 +- .../Magento/Customer/Block/Address/Book.php | 8 +++---- .../Magento/Customer/Block/Address/Edit.php | 6 ++--- .../Address/Renderer/DefaultRenderer.php | 7 +++--- .../Block/Adminhtml/Edit/Tab/Account.php | 4 ++-- .../Tab/Newsletter/Grid/Filter/Status.php | 2 +- .../Block/Adminhtml/Edit/Tab/View/Sales.php | 2 +- .../Block/Adminhtml/Form/Element/File.php | 2 +- .../Customer/Block/Adminhtml/Group/Edit.php | 2 +- .../Block/Adminhtml/Group/Edit/Form.php | 4 ++-- .../Sales/Order/Address/Form/Renderer/Vat.php | 2 +- app/code/Magento/Customer/Block/Form/Edit.php | 2 +- .../Customer/Block/Form/Login/Info.php | 2 +- .../Magento/Customer/Block/Form/Register.php | 4 ++-- .../Magento/Customer/Block/Widget/Dob.php | 8 +++---- .../Controller/Account/CreatePost.php | 4 ++-- .../Controller/Adminhtml/Group/NewAction.php | 2 +- .../Controller/Adminhtml/Group/Save.php | 2 +- .../Controller/Adminhtml/Index/Save.php | 2 +- .../Config/Validatevat/ValidateAdvanced.php | 2 +- app/code/Magento/Customer/Model/Address.php | 4 ++-- .../Model/Address/AbstractAddress.php | 4 ++-- .../Magento/Customer/Model/Address/Config.php | 2 +- .../Model/Attribute/Backend/Data/Boolean.php | 2 +- app/code/Magento/Customer/Model/Customer.php | 2 +- .../Customer/Attribute/Backend/Billing.php | 2 +- .../Customer/Attribute/Backend/Shipping.php | 2 +- .../Customer/Model/CustomerRegistry.php | 4 ++-- .../Customer/Model/GroupManagement.php | 4 ++-- .../Magento/Customer/Model/GroupRegistry.php | 2 +- .../Model/Metadata/AddressMetadata.php | 2 +- .../Model/Metadata/CachedMetadata.php | 4 ++-- .../Model/Metadata/CustomerMetadata.php | 2 +- .../Customer/Model/Metadata/Form/Date.php | 10 ++++----- .../Customer/Model/Metadata/Form/File.php | 4 ++-- .../Customer/Model/Metadata/Form/Image.php | 6 ++--- .../Customer/Model/Metadata/Form/Text.php | 4 ++-- .../Model/Resource/AddressRepository.php | 2 +- .../Customer/Grid/ServiceCollection.php | 2 +- .../Model/Resource/CustomerRepository.php | 6 ++--- .../Customer/Test/Unit/Helper/AddressTest.php | 2 +- .../Model/Metadata/Form/AbstractDataTest.php | 2 +- app/code/Magento/Directory/Block/Currency.php | 4 ++-- app/code/Magento/Directory/Block/Data.php | 8 +++---- app/code/Magento/Directory/Helper/Data.php | 2 +- app/code/Magento/Directory/Model/Currency.php | 2 +- app/code/Magento/Directory/Model/Region.php | 2 +- .../Product/Edit/Tab/Downloadable/Links.php | 4 ++-- .../Product/Edit/Tab/Downloadable/Samples.php | 2 +- .../Downloadable/Model/Product/Price.php | 2 +- .../Downloadable/Model/Product/Type.php | 4 ++-- .../Attribute/Edit/Options/Options.php | 2 +- .../Eav/Model/AttributeSetRepository.php | 2 +- .../Entity/Attribute/AbstractAttribute.php | 2 +- .../Entity/Attribute/Backend/Time/Created.php | 2 +- .../Model/Entity/Attribute/Source/Boolean.php | 2 +- app/code/Magento/Eav/Model/Form.php | 16 +++++++------- .../Eav/Model/Resource/Entity/Attribute.php | 10 ++++----- .../Entity/Attribute/Option/Collection.php | 2 +- .../Resource/Form/Fieldset/Collection.php | 2 +- .../Magento/Eav/Model/Resource/Form/Type.php | 2 +- .../Adminhtml/Template/Grid/Filter/Type.php | 2 +- .../Magento/Email/Model/AbstractTemplate.php | 2 +- .../Magento/Email/Model/Resource/Template.php | 2 +- app/code/Magento/Email/Model/Template.php | 2 +- .../GiftMessage/Block/Message/Inline.php | 2 +- .../GiftMessage/Model/GiftMessageManager.php | 4 ++-- app/code/Magento/GiftMessage/Model/Save.php | 2 +- .../Block/Adminhtml/Types/Edit.php | 2 +- .../Adminhtml/Googleshopping/Types.php | 2 +- .../Adminhtml/Googleshopping/Types/Save.php | 2 +- .../Magento/GoogleShopping/Helper/Data.php | 2 +- .../Model/Attribute/Condition.php | 4 ++-- .../Model/Attribute/Content.php | 4 ++-- .../Attribute/SalePriceEffectiveDate.php | 8 +++---- .../GoogleShopping/Model/Attribute/Tax.php | 4 ++-- .../GoogleShopping/Model/Attribute/Title.php | 4 ++-- .../Magento/GoogleShopping/Model/Item.php | 4 ++-- .../Magento/GoogleShopping/Model/Type.php | 6 ++--- .../Import/Product/Type/Grouped/Links.php | 2 +- .../Product/Composite/Fieldset/Grouped.php | 2 +- .../Model/Product/Type/Grouped.php | 2 +- .../Model/Product/Type/Grouped/Price.php | 2 +- .../Model/Resource/Indexer/Stock/Grouped.php | 2 +- .../Product/Indexer/Price/Grouped.php | 2 +- .../Pricing/Price/FinalPrice.php | 2 +- .../Model/Resource/AbstractResource.php | 2 +- .../Log/Model/Resource/Aggregation.php | 2 +- app/code/Magento/Log/Model/Visitor/Online.php | 2 +- .../MediaStorage/Helper/File/Storage.php | 4 ++-- .../Helper/File/Storage/Database.php | 4 ++-- .../Model/File/Storage/Database.php | 2 +- .../MediaStorage/Model/File/Storage/File.php | 2 +- .../MediaStorage/Model/File/Uploader.php | 2 +- .../Block/Checkout/Address/Select.php | 2 +- .../Block/Checkout/Addresses.php | 2 +- .../Multishipping/Block/Checkout/Billing.php | 2 +- .../Multishipping/Block/Checkout/Overview.php | 2 +- .../Multishipping/Block/Checkout/Shipping.php | 2 +- .../Newsletter/Block/Adminhtml/Subscriber.php | 2 +- .../Subscriber/Grid/Filter/Website.php | 2 +- .../Newsletter/Controller/Manage/Save.php | 2 +- app/code/Magento/Newsletter/Model/Problem.php | 2 +- app/code/Magento/Newsletter/Model/Queue.php | 6 ++--- .../Magento/Newsletter/Model/Subscriber.php | 2 +- .../Block/Form/AbstractInstruction.php | 2 +- .../OfflinePayments/Block/Info/Checkmo.php | 4 ++-- .../Adminhtml/Carrier/Tablerate/Grid.php | 2 +- .../Model/Resource/Carrier/Tablerate.php | 4 ++-- app/code/Magento/Payment/Block/Form/Cc.php | 6 ++--- .../Payment/Block/Info/Instructions.php | 2 +- app/code/Magento/Payment/Model/Info.php | 2 +- app/code/Magento/Payment/Model/Method/Cc.php | 2 +- .../Magento/Persistent/Helper/Session.php | 6 ++--- .../Persistent/Model/Persistent/Config.php | 2 +- app/code/Magento/Persistent/Model/Session.php | 2 +- app/code/Magento/ProductAlert/Helper/Data.php | 2 +- app/code/Magento/ProductAlert/Model/Email.php | 6 ++--- .../Magento/ProductAlert/Model/Observer.php | 2 +- app/code/Magento/ProductAlert/Model/Price.php | 2 +- .../Model/Resource/Price/Collection.php | 2 +- .../Model/Resource/Stock/Collection.php | 2 +- app/code/Magento/ProductAlert/Model/Stock.php | 2 +- .../Quote/Model/PaymentMethodManagement.php | 4 ++-- .../Quote/Model/Quote/Address/Total/Tax.php | 2 +- .../Quote/Model/Quote/Item/AbstractItem.php | 8 +++---- .../Block/Adminhtml/Grid/AbstractGrid.php | 6 ++--- .../Grid/Column/Renderer/Blanknumber.php | 2 +- .../Reports/Block/Adminhtml/Grid/Shopcart.php | 2 +- .../Sales/Grid/Column/Renderer/Date.php | 2 +- .../Reports/Block/Product/AbstractProduct.php | 2 +- .../Adminhtml/Report/AbstractReport.php | 2 +- .../Adminhtml/Report/Statistics.php | 2 +- app/code/Magento/Reports/Model/Event.php | 2 +- .../Magento/Reports/Model/Event/Observer.php | 2 +- .../Report/Collection/AbstractCollection.php | 2 +- app/code/Magento/Rss/Model/Rss.php | 2 +- .../Model/Condition/AbstractCondition.php | 4 ++-- .../Magento/Rule/Model/Condition/Combine.php | 2 +- .../Condition/Product/AbstractProduct.php | 4 ++-- .../Block/Adminhtml/Items/AbstractItems.php | 16 +++++++------- .../Block/Adminhtml/Order/AbstractOrder.php | 2 +- .../Sales/Block/Adminhtml/Order/Create.php | 4 ++-- .../Block/Adminhtml/Order/Create/Form.php | 8 +++---- .../Order/Create/Form/AbstractForm.php | 2 +- .../Adminhtml/Order/Create/Form/Address.php | 2 +- .../Order/Create/Giftmessage/Form.php | 2 +- .../Adminhtml/Order/Create/Items/Grid.php | 2 +- .../Order/Create/Sidebar/AbstractSidebar.php | 2 +- .../Adminhtml/Order/Create/Sidebar/Cart.php | 2 +- .../Order/Create/Sidebar/Compared.php | 2 +- .../Order/Create/Sidebar/Pcompared.php | 2 +- .../Order/Create/Sidebar/Pviewed.php | 2 +- .../Order/Create/Sidebar/Wishlist.php | 2 +- .../Block/Adminhtml/Order/Create/Totals.php | 4 ++-- .../Order/Creditmemo/Create/Items.php | 2 +- .../Adminhtml/Order/Invoice/Create/Form.php | 2 +- .../Adminhtml/Order/View/Giftmessage.php | 4 ++-- .../Sales/Block/Adminhtml/Order/View/Info.php | 4 ++-- .../Magento/Sales/Block/Order/Comments.php | 2 +- .../Magento/Sales/Block/Widget/Guest/Form.php | 2 +- .../Controller/Adminhtml/Order/Create.php | 5 ++--- app/code/Magento/Sales/Model/Order.php | 12 +++++----- .../Sales/Model/Order/Creditmemo/Item.php | 2 +- .../Magento/Sales/Model/Order/Invoice.php | 4 ++-- .../Sales/Model/Order/Invoice/Item.php | 2 +- app/code/Magento/Sales/Model/Order/Item.php | 10 ++++----- .../Sales/Model/Order/Status/History.php | 2 +- .../Order/Attribute/Backend/Billing.php | 2 +- .../Order/Attribute/Backend/Shipping.php | 2 +- .../Sales/Model/Resource/Order/Collection.php | 2 +- .../Report/Collection/AbstractCollection.php | 2 +- .../Sales/Model/Resource/Sale/Collection.php | 2 +- .../Magento/Sales/Model/Rss/OrderStatus.php | 2 +- .../AddVatRequestParamsOrderCommentTest.php | 2 +- .../Promo/Quote/Edit/Tab/Coupons.php | 2 +- app/code/Magento/Search/Model/Query.php | 2 +- .../Magento/Sendfriend/Model/Sendfriend.php | 2 +- .../Model/Resource/Catalog/Product.php | 2 +- app/code/Magento/Store/Block/Switcher.php | 2 +- .../Magento/Store/Model/App/Emulation.php | 2 +- app/code/Magento/Store/Model/Group.php | 12 +++++----- .../Resource/Config/Collection/Scoped.php | 2 +- app/code/Magento/Store/Model/Storage/Db.php | 4 ++-- .../Magento/Store/Model/StorageFactory.php | 2 +- app/code/Magento/Store/Model/Store.php | 12 +++++----- app/code/Magento/Store/Model/System/Store.php | 2 +- app/code/Magento/Store/Model/Website.php | 22 +++++++++---------- .../Adminhtml/Rate/Grid/Renderer/Data.php | 2 +- .../Tax/Block/Adminhtml/Rate/Title.php | 4 ++-- app/code/Magento/Tax/Model/Calculation.php | 6 ++--- .../Tax/Model/Calculation/Rule/Validator.php | 4 ++-- .../Tax/Model/Resource/Calculation.php | 2 +- app/code/Magento/Tax/Model/TaxCalculation.php | 6 ++--- .../Magento/Theme/Block/Html/Breadcrumbs.php | 2 +- .../Magento/Theme/Block/Html/Header/Logo.php | 2 +- app/code/Magento/Theme/Block/Html/Topmenu.php | 2 +- .../Theme/Model/Config/Customization.php | 4 ++-- app/code/Magento/Theme/Model/Design.php | 2 +- .../Magento/Theme/Model/Favicon/Favicon.php | 2 +- .../Model/Resource/Design/Collection.php | 2 +- .../Magento/Theme/Model/Uploader/Service.php | 2 +- .../Translation/Model/Resource/String.php | 8 +++---- .../Translation/Model/Resource/Translate.php | 4 ++-- .../Ui/Component/Layout/Tabs/TabWrapper.php | 6 ++--- app/code/Magento/Ui/DataProvider/Metadata.php | 2 +- .../Unit/Component/Control/ButtonTest.php | 4 ++-- .../Block/Catalog/Category/Tree.php | 2 +- .../Magento/UrlRewrite/Block/Edit/Form.php | 4 ++-- .../UrlRewrite/Model/Resource/UrlRewrite.php | 2 +- app/code/Magento/User/Model/User.php | 2 +- .../Controller/Soap/Request/Handler.php | 2 +- app/code/Magento/Weee/Helper/Data.php | 2 +- app/code/Magento/Weee/Model/Tax.php | 2 +- .../Magento/Widget/Model/Config/Converter.php | 8 +++---- .../Magento/Widget/Model/Widget/Instance.php | 2 +- .../Magento/Wishlist/Block/AbstractBlock.php | 2 +- .../Wishlist/Block/Customer/Sharing.php | 2 +- .../Wishlist/Block/Customer/Sidebar.php | 2 +- .../Magento/Wishlist/Block/Share/Wishlist.php | 2 +- .../Wishlist/Controller/Index/Update.php | 2 +- app/code/Magento/Wishlist/Helper/Data.php | 4 ++-- app/code/Magento/Wishlist/Helper/Rss.php | 4 ++-- .../Model/Resource/Item/Collection.php | 2 +- app/code/Magento/Wishlist/Model/Wishlist.php | 8 +++---- .../TestModule1/Service/V1/AllSoapAndRest.php | 2 +- .../TestModuleMSC/Model/AllSoapAndRest.php | 2 +- .../Authentication/OauthHelper.php | 4 ++-- .../TestCase/Webapi/Adapter/Rest.php | 2 +- .../Adapter/Rest/DocumentationGenerator.php | 4 ++-- .../TestCase/Webapi/Adapter/Soap.php | 2 +- .../TestFramework/TestCase/WebapiAbstract.php | 6 ++--- .../Customer/Api/CustomerRepositoryTest.php | 2 +- .../Downloadable/Api/LinkRepositoryTest.php | 2 +- .../Downloadable/Api/SampleRepositoryTest.php | 2 +- .../Sales/Service/V1/TransactionTest.php | 2 +- .../Magento/Tax/Api/TaxRateRepositoryTest.php | 6 ++--- .../Api/TaxRuleRepositoryInterfaceTest.php | 6 ++--- .../Mtf/Util/Protocol/CurlTransport.php | 2 +- .../AssertProductAttributeIsConfigurable.php | 2 +- .../TestCase/AbstractController.php | 2 +- .../Filter/Price/AlgorithmAdvancedTest.php | 2 +- .../Customer/Api/AddressRepositoryTest.php | 2 +- .../Block/Adminhtml/Edit/Tab/AccountTest.php | 2 +- .../Customer/Model/AccountManagementTest.php | 2 +- .../Model/Resource/AddressRepositoryTest.php | 4 ++-- .../Model/Resource/CustomerRepositoryTest.php | 2 +- .../Model/Resource/GroupRepositoryTest.php | 2 +- .../Model/Export/CustomerTest.php | 2 +- .../View/Element/AbstractBlockTest.php | 2 +- .../Controller/Adminhtml/ExportTest.php | 2 +- .../Report/Product/Viewed/CollectionTest.php | 2 +- .../Sales/Model/AdminOrder/CreateTest.php | 2 +- .../Model/Calculation/RateRepositoryTest.php | 2 +- .../Tax/Model/TaxRuleRepositoryTest.php | 2 +- .../Magento/TestFramework/Helper/Cli.php | 2 +- .../RequireAnnotatedAttributesSniff.php | 2 +- .../RequireAnnotatedMethodsSniff.php | 2 +- .../TestFramework/Dependency/PhpRule.php | 4 ++-- .../Integrity/AbstractConfig.php | 8 +++---- .../InterceptionConfigurationBuilder.php | 2 +- .../Di/Code/Reader/ClassReaderDecorator.php | 2 +- .../Scanner/InterceptedInstancesScanner.php | 4 ++-- .../Tools/Di/Code/Scanner/PluginScanner.php | 2 +- .../Di/Code/Scanner/RepositoryScanner.php | 4 ++-- .../Tools/Di/Compiler/ArgumentsResolver.php | 2 +- .../I18n/Parser/Adapter/Php/Tokenizer.php | 2 +- .../Magento/ToolkitFramework/Helper/Cli.php | 2 +- lib/internal/Cm/Cache/Backend/Redis.php | 2 +- lib/internal/Less/Parser.php | 4 ++-- lib/internal/Less/Tree/Ruleset.php | 2 +- .../Acl/Resource/Config/Converter/Dom.php | 10 ++++----- .../Framework/Api/DataObjectHelper.php | 2 +- .../Framework/Api/Search/FilterGroup.php | 2 +- .../Magento/Framework/Api/SearchResults.php | 2 +- lib/internal/Magento/Framework/App/Area.php | 2 +- .../Framework/App/Config/Initial/Reader.php | 2 +- .../Framework/App/Config/ScopePool.php | 2 +- .../Magento/Framework/App/Request/Http.php | 2 +- .../App/Response/Http/FileFactory.php | 4 ++-- .../Magento/Framework/App/Router/Base.php | 2 +- .../Framework/Autoload/AutoloaderRegistry.php | 2 +- .../Magento/Framework/Backup/Snapshot.php | 2 +- .../Magento/Framework/DB/Ddl/Table.php | 2 +- .../Magento/Framework/DB/Ddl/Trigger.php | 4 ++-- lib/internal/Magento/Framework/DB/Helper.php | 2 +- lib/internal/Magento/Framework/DB/Query.php | 2 +- .../Framework/Data/AbstractSearchResult.php | 2 +- .../Magento/Framework/Data/Collection.php | 4 ++-- .../Magento/Framework/Data/Collection/Db.php | 10 ++++----- .../Data/Form/Element/AbstractElement.php | 4 ++-- .../Framework/Data/Form/Element/Hidden.php | 2 +- .../Framework/Data/Form/Element/Radios.php | 2 +- .../Framework/Data/Form/Filter/Date.php | 2 +- lib/internal/Magento/Framework/Data/Tree.php | 2 +- .../Magento/Framework/Data/Tree/Db.php | 4 ++-- lib/internal/Magento/Framework/Debug.php | 4 ++-- .../Framework/Exception/InputException.php | 2 +- .../Exception/LocalizedException.php | 2 +- .../Exception/NoSuchEntityException.php | 2 +- .../Exception/SerializationException.php | 2 +- .../Magento/Framework/Filesystem/Io/File.php | 6 ++--- .../Magento/Framework/Filesystem/Io/Ftp.php | 4 ++-- lib/internal/Magento/Framework/Flag.php | 4 ++-- .../Framework/Gdata/Gshopping/Content.php | 2 +- .../Magento/Framework/HTTP/Client/Curl.php | 4 ++-- .../Magento/Framework/HTTP/Client/Socket.php | 4 ++-- .../HTTP/PhpEnvironment/RemoteAddress.php | 2 +- .../HTTP/PhpEnvironment/Response.php | 4 ++-- .../Interception/Code/InterfaceValidator.php | 6 ++--- .../Magento/Framework/Locale/Format.php | 2 +- .../Magento/Framework/Model/AbstractModel.php | 2 +- .../Model/Resource/Db/AbstractDb.php | 16 +++++++------- .../Module/Declaration/Converter/Dom.php | 6 ++--- lib/internal/Magento/Framework/Object.php | 4 ++-- .../Magento/Framework/Object/Cache.php | 6 ++--- .../Magento/Framework/Object/Copy.php | 4 ++-- .../Object/Copy/Config/Converter.php | 2 +- .../Magento/Framework/Pricing/Price/Pool.php | 2 +- .../Framework/Reflection/TypeProcessor.php | 2 +- .../Adapter/Mysql/Aggregation/Interval.php | 10 ++++----- .../Adapter/Mysql/Filter/Builder/Range.php | 2 +- .../Adapter/Mysql/Query/Builder/Match.php | 2 +- .../Framework/Search/Dynamic/Algorithm.php | 12 +++++----- .../Framework/Search/Request/Builder.php | 2 +- .../Unit/Adapter/Mysql/Filter/BuilderTest.php | 4 ++-- .../Framework/Session/SessionManager.php | 2 +- .../Framework/Stdlib/Cookie/CookieScope.php | 12 +++++----- .../Magento/Framework/Stdlib/String.php | 2 +- lib/internal/Magento/Framework/Translate.php | 2 +- .../Translate/Locale/Resolver/Plugin.php | 2 +- .../Magento/Framework/Url/Helper/Data.php | 2 +- .../Framework/Validator/AbstractValidator.php | 4 ++-- .../Framework/View/Element/AbstractBlock.php | 16 +++++++------- .../Framework/View/Element/Html/Link.php | 2 +- lib/internal/Magento/Framework/View/File.php | 2 +- .../Webapi/Rest/Response/FieldsFilter.php | 2 +- .../Webapi/ServiceOutputProcessor.php | 2 +- 492 files changed, 848 insertions(+), 854 deletions(-) diff --git a/app/code/Magento/AdminNotification/Model/Feed.php b/app/code/Magento/AdminNotification/Model/Feed.php index e9416028a9aa9..de2cd1fc5515e 100644 --- a/app/code/Magento/AdminNotification/Model/Feed.php +++ b/app/code/Magento/AdminNotification/Model/Feed.php @@ -114,7 +114,7 @@ protected function _construct() public function getFeedUrl() { $httpPath = $this->_backendConfig->isSetFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://'; - if (is_null($this->_feedUrl)) { + if ($this->_feedUrl === null) { $this->_feedUrl = $httpPath . $this->_backendConfig->getValue(self::XML_FEED_URL_PATH); } return $this->_feedUrl; diff --git a/app/code/Magento/AdminNotification/Model/Inbox.php b/app/code/Magento/AdminNotification/Model/Inbox.php index c1b53b9dea79d..f10b4f031276e 100644 --- a/app/code/Magento/AdminNotification/Model/Inbox.php +++ b/app/code/Magento/AdminNotification/Model/Inbox.php @@ -55,7 +55,7 @@ public function getSeverities($severity = null) MessageInterface::SEVERITY_NOTICE => __('notice'), ]; - if (!is_null($severity)) { + if ($severity !== null) { if (isset($severities[$severity])) { return $severities[$severity]; } diff --git a/app/code/Magento/Authorization/Model/CompositeUserContext.php b/app/code/Magento/Authorization/Model/CompositeUserContext.php index 574993e2c4b3a..1bfe539259dc0 100644 --- a/app/code/Magento/Authorization/Model/CompositeUserContext.php +++ b/app/code/Magento/Authorization/Model/CompositeUserContext.php @@ -72,15 +72,15 @@ public function getUserType() */ protected function getUserContext() { - if (is_null($this->chosenUserContext)) { + if ($this->chosenUserContext === null) { /** @var UserContextInterface $userContext */ foreach ($this->userContexts as $userContext) { - if ($userContext->getUserType() && !is_null($userContext->getUserId())) { + if ($userContext->getUserType() && $userContext->getUserId() !== null) { $this->chosenUserContext = $userContext; break; } } - if (is_null($this->chosenUserContext)) { + if ($this->chosenUserContext === null) { $this->chosenUserContext = false; } } diff --git a/app/code/Magento/Authorization/Test/Unit/Model/CompositeUserContextTest.php b/app/code/Magento/Authorization/Test/Unit/Model/CompositeUserContextTest.php index 8175bbdd3ee83..dc4639b4f7d8c 100644 --- a/app/code/Magento/Authorization/Test/Unit/Model/CompositeUserContextTest.php +++ b/app/code/Magento/Authorization/Test/Unit/Model/CompositeUserContextTest.php @@ -161,7 +161,7 @@ protected function createUserContextMock($userId = null, $userType = null) { $useContextMock = $this->getMockBuilder('Magento\Authorization\Model\CompositeUserContext') ->disableOriginalConstructor()->setMethods(['getUserId', 'getUserType'])->getMock(); - if (!is_null($userId) && !is_null($userType)) { + if ($userId !== null && $userType !== null) { $useContextMock->expects($this->any())->method('getUserId')->will($this->returnValue($userId)); $useContextMock->expects($this->any())->method('getUserType')->will($this->returnValue($userType)); } diff --git a/app/code/Magento/Backend/App/AbstractAction.php b/app/code/Magento/Backend/App/AbstractAction.php index eba77d1795371..4be4b77472880 100644 --- a/app/code/Magento/Backend/App/AbstractAction.php +++ b/app/code/Magento/Backend/App/AbstractAction.php @@ -289,7 +289,7 @@ protected function _processLocaleSettings() $this->_getSession()->setSessionLocale($forceLocale); } - if (is_null($this->_getSession()->getLocale())) { + if ($this->_getSession()->getLocale() === null) { $this->_getSession()->setLocale($this->_localeResolver->getLocale()); } diff --git a/app/code/Magento/Backend/Block/Dashboard/Bar.php b/app/code/Magento/Backend/Block/Dashboard/Bar.php index 3902e04b00bf0..d3df53752dfbd 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Bar.php +++ b/app/code/Magento/Backend/Block/Dashboard/Bar.php @@ -84,7 +84,7 @@ public function setCurrency($currency) */ public function getCurrency() { - if (is_null($this->_currentCurrencyCode)) { + if ($this->_currentCurrencyCode === null) { if ($this->getRequest()->getParam('store')) { $this->_currentCurrencyCode = $this->_storeManager->getStore( $this->getRequest()->getParam('store') diff --git a/app/code/Magento/Backend/Block/Dashboard/Graph.php b/app/code/Magento/Backend/Block/Dashboard/Graph.php index 5911a361b0299..176212e32f934 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Graph.php +++ b/app/code/Magento/Backend/Block/Dashboard/Graph.php @@ -545,7 +545,7 @@ public function setDataHelper(\Magento\Backend\Helper\Dashboard\AbstractDashboar */ protected function _prepareData() { - if (!is_null($this->_dataHelper)) { + if ($this->_dataHelper !== null) { $availablePeriods = array_keys($this->_dashboardData->getDatePeriods()); $period = $this->getRequest()->getParam('period'); $this->getDataHelper()->setParam( diff --git a/app/code/Magento/Backend/Block/Store/Switcher.php b/app/code/Magento/Backend/Block/Store/Switcher.php index 7898ffc80cc6a..a224e2a3b40d9 100644 --- a/app/code/Magento/Backend/Block/Store/Switcher.php +++ b/app/code/Magento/Backend/Block/Store/Switcher.php @@ -139,7 +139,7 @@ public function getWebsiteCollection() $collection = $this->_websiteFactory->create()->getResourceCollection(); $websiteIds = $this->getWebsiteIds(); - if (!is_null($websiteIds)) { + if ($websiteIds !== null) { $collection->addIdFilter($this->getWebsiteIds()); } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column.php b/app/code/Magento/Backend/Block/Widget/Grid/Column.php index f5af4bf45fc6f..666544b8f6857 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column.php @@ -405,7 +405,7 @@ protected function _getRendererByType() */ public function getRenderer() { - if (is_null($this->_renderer)) { + if ($this->_renderer === null) { $rendererClass = $this->getData('renderer'); if (empty($rendererClass)) { $rendererClass = $this->_getRendererByType(); @@ -460,9 +460,9 @@ protected function _getFilterByType() */ public function getFilter() { - if (is_null($this->_filter)) { + if ($this->_filter === null) { $filterClass = $this->getData('filter'); - if (false === (bool)$filterClass && false === is_null($filterClass)) { + if (false === (bool)$filterClass && false === ($filterClass === null)) { return false; } if (!$filterClass) { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Price.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Price.php index 0e04e3098d5c0..8164f1a4e3d08 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Price.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Price.php @@ -103,7 +103,7 @@ public function getHtml() */ public function getDisplayCurrencySelect() { - if (!is_null($this->getColumn()->getData('display_currency_select'))) { + if ($this->getColumn()->getData('display_currency_select') !== null) { return $this->getColumn()->getData('display_currency_select'); } else { return true; @@ -117,7 +117,7 @@ public function getDisplayCurrencySelect() */ public function getCurrencyAffect() { - if (!is_null($this->getColumn()->getData('currency_affect'))) { + if ($this->getColumn()->getData('currency_affect') !== null) { return $this->getColumn()->getData('currency_affect'); } else { return true; @@ -153,7 +153,7 @@ protected function _getCurrencySelectHtml() */ protected function _getCurrencyList() { - if (is_null($this->_currencyList)) { + if ($this->_currencyList === null) { $this->_currencyList = $this->_currencyModel->getConfigAllowCurrencies(); } return $this->_currencyList; diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Select.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Select.php index 5193fa8bbeef3..1a87e74881a30 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Select.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Select.php @@ -50,7 +50,7 @@ protected function _getOptions() */ protected function _renderOption($option, $value) { - $selected = $option['value'] == $value && !is_null($value) ? ' selected="selected"' : ''; + $selected = $option['value'] == $value && $value !== null ? ' selected="selected"' : ''; return ''; } } @@ -109,7 +109,7 @@ protected function _drawOptions($options) */ public function getCondition() { - if (is_null($this->getValue())) { + if ($this->getValue() === null) { return null; } $value = $this->getValue(); diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php index a0a9a97fc45dc..3695d9df3eec3 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php @@ -48,7 +48,7 @@ public function __construct( */ public function getValues() { - if (is_null($this->_values)) { + if ($this->_values === null) { $this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : []; } return $this->_values; diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php index 320c05567a6f7..10ffb0599530b 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php @@ -40,7 +40,7 @@ protected function _getFormat() { $format = $this->getColumn()->getFormat(); if (!$format) { - if (is_null(self::$_format)) { + if (self::$_format === null) { try { self::$_format = $this->_localeDate->getDateFormat( \IntlDateFormatter::MEDIUM diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Number.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Number.php index 019eeab8c439f..f3e22234473ac 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Number.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Number.php @@ -26,7 +26,7 @@ class Number extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstract protected function _getValue(\Magento\Framework\Object $row) { $data = parent::_getValue($row); - if (!is_null($data)) { + if ($data !== null) { $value = $data * 1; $sign = (bool)(int)$this->getColumn()->getShowNumberSign() && $value > 0 ? '+' : ''; if ($sign) { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Radio.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Radio.php index 4b1a18fd7c3a7..f84c7e020de83 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Radio.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Radio.php @@ -59,7 +59,7 @@ protected function _getValues() */ public function getValues() { - if (is_null($this->_values)) { + if ($this->_values === null) { $this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : []; } return $this->_values; diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Select.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Select.php index 92054dc371491..faa369e4f8f22 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Select.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Select.php @@ -54,7 +54,7 @@ public function render(\Magento\Framework\Object $row) $html = '