Skip to content

Commit 28cf7e4

Browse files
author
Bryant Luk
committed
Merge branch 'develop' into MAGETWO-35266-Update-fails-trying-to-recreate-tables
2 parents 051c1ce + b456cd1 commit 28cf7e4

File tree

529 files changed

+1273
-975
lines changed

Some content is hidden

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

529 files changed

+1273
-975
lines changed

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function _construct()
114114
public function getFeedUrl()
115115
{
116116
$httpPath = $this->_backendConfig->isSetFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://';
117-
if (is_null($this->_feedUrl)) {
117+
if ($this->_feedUrl === null) {
118118
$this->_feedUrl = $httpPath . $this->_backendConfig->getValue(self::XML_FEED_URL_PATH);
119119
}
120120
return $this->_feedUrl;

app/code/Magento/AdminNotification/Model/Inbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getSeverities($severity = null)
5555
MessageInterface::SEVERITY_NOTICE => __('notice'),
5656
];
5757

58-
if (!is_null($severity)) {
58+
if ($severity !== null) {
5959
if (isset($severities[$severity])) {
6060
return $severities[$severity];
6161
}

app/code/Magento/Authorization/Model/CompositeUserContext.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ public function getUserType()
7272
*/
7373
protected function getUserContext()
7474
{
75-
if (is_null($this->chosenUserContext)) {
75+
if ($this->chosenUserContext === null) {
7676
/** @var UserContextInterface $userContext */
7777
foreach ($this->userContexts as $userContext) {
78-
if ($userContext->getUserType() && !is_null($userContext->getUserId())) {
78+
if ($userContext->getUserType() && $userContext->getUserId() !== null) {
7979
$this->chosenUserContext = $userContext;
8080
break;
8181
}
8282
}
83-
if (is_null($this->chosenUserContext)) {
83+
if ($this->chosenUserContext === null) {
8484
$this->chosenUserContext = false;
8585
}
8686
}

app/code/Magento/Authorization/Test/Unit/Model/CompositeUserContextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ protected function createUserContextMock($userId = null, $userType = null)
161161
{
162162
$useContextMock = $this->getMockBuilder('Magento\Authorization\Model\CompositeUserContext')
163163
->disableOriginalConstructor()->setMethods(['getUserId', 'getUserType'])->getMock();
164-
if (!is_null($userId) && !is_null($userType)) {
164+
if ($userId !== null && $userType !== null) {
165165
$useContextMock->expects($this->any())->method('getUserId')->will($this->returnValue($userId));
166166
$useContextMock->expects($this->any())->method('getUserType')->will($this->returnValue($userType));
167167
}

app/code/Magento/Backend/App/AbstractAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ protected function _processLocaleSettings()
289289
$this->_getSession()->setSessionLocale($forceLocale);
290290
}
291291

292-
if (is_null($this->_getSession()->getLocale())) {
292+
if ($this->_getSession()->getLocale() === null) {
293293
$this->_getSession()->setLocale($this->_localeResolver->getLocale());
294294
}
295295

app/code/Magento/Backend/Block/Dashboard/Bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function setCurrency($currency)
8484
*/
8585
public function getCurrency()
8686
{
87-
if (is_null($this->_currentCurrencyCode)) {
87+
if ($this->_currentCurrencyCode === null) {
8888
if ($this->getRequest()->getParam('store')) {
8989
$this->_currentCurrencyCode = $this->_storeManager->getStore(
9090
$this->getRequest()->getParam('store')

app/code/Magento/Backend/Block/Dashboard/Graph.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ public function setDataHelper(\Magento\Backend\Helper\Dashboard\AbstractDashboar
545545
*/
546546
protected function _prepareData()
547547
{
548-
if (!is_null($this->_dataHelper)) {
548+
if ($this->_dataHelper !== null) {
549549
$availablePeriods = array_keys($this->_dashboardData->getDatePeriods());
550550
$period = $this->getRequest()->getParam('period');
551551
$this->getDataHelper()->setParam(

app/code/Magento/Backend/Block/Store/Switcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function getWebsiteCollection()
139139
$collection = $this->_websiteFactory->create()->getResourceCollection();
140140

141141
$websiteIds = $this->getWebsiteIds();
142-
if (!is_null($websiteIds)) {
142+
if ($websiteIds !== null) {
143143
$collection->addIdFilter($this->getWebsiteIds());
144144
}
145145

app/code/Magento/Backend/Block/Widget/Grid/Column.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ protected function _getRendererByType()
405405
*/
406406
public function getRenderer()
407407
{
408-
if (is_null($this->_renderer)) {
408+
if ($this->_renderer === null) {
409409
$rendererClass = $this->getData('renderer');
410410
if (empty($rendererClass)) {
411411
$rendererClass = $this->_getRendererByType();
@@ -460,9 +460,9 @@ protected function _getFilterByType()
460460
*/
461461
public function getFilter()
462462
{
463-
if (is_null($this->_filter)) {
463+
if ($this->_filter === null) {
464464
$filterClass = $this->getData('filter');
465-
if (false === (bool)$filterClass && false === is_null($filterClass)) {
465+
if (false === (bool)$filterClass && false === ($filterClass === null)) {
466466
return false;
467467
}
468468
if (!$filterClass) {

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ protected function _convertDate($date)
205205
\IntlDateFormatter::NONE,
206206
$adminTimeZone
207207
);
208-
$simpleRes = new \DateTime('@' . $formatter->parse($date), $adminTimeZone);
208+
$simpleRes = new \DateTime(null, $adminTimeZone);
209+
$simpleRes->setTimestamp($formatter->parse($date));
209210
$simpleRes->setTime(0, 0, 0);
210211
$simpleRes->setTimezone(new \DateTimeZone('UTC'));
211212
return $simpleRes;

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Price.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getHtml()
103103
*/
104104
public function getDisplayCurrencySelect()
105105
{
106-
if (!is_null($this->getColumn()->getData('display_currency_select'))) {
106+
if ($this->getColumn()->getData('display_currency_select') !== null) {
107107
return $this->getColumn()->getData('display_currency_select');
108108
} else {
109109
return true;
@@ -117,7 +117,7 @@ public function getDisplayCurrencySelect()
117117
*/
118118
public function getCurrencyAffect()
119119
{
120-
if (!is_null($this->getColumn()->getData('currency_affect'))) {
120+
if ($this->getColumn()->getData('currency_affect') !== null) {
121121
return $this->getColumn()->getData('currency_affect');
122122
} else {
123123
return true;
@@ -153,7 +153,7 @@ protected function _getCurrencySelectHtml()
153153
*/
154154
protected function _getCurrencyList()
155155
{
156-
if (is_null($this->_currencyList)) {
156+
if ($this->_currencyList === null) {
157157
$this->_currencyList = $this->_currencyModel->getConfigAllowCurrencies();
158158
}
159159
return $this->_currencyList;

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Select.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function _getOptions()
5050
*/
5151
protected function _renderOption($option, $value)
5252
{
53-
$selected = $option['value'] == $value && !is_null($value) ? ' selected="selected"' : '';
53+
$selected = $option['value'] == $value && $value !== null ? ' selected="selected"' : '';
5454
return '<option value="' . $this->escapeHtml(
5555
$option['value']
5656
) . '"' . $selected . '>' . $this->escapeHtml(
@@ -88,7 +88,7 @@ public function getHtml()
8888
*/
8989
public function getCondition()
9090
{
91-
if (is_null($this->getValue())) {
91+
if ($this->getValue() === null) {
9292
return null;
9393
}
9494
return ['eq' => $this->getValue()];

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Store.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function getHtml()
115115
public function getCondition()
116116
{
117117
$value = $this->getValue();
118-
if (is_null($value) || $value == self::ALL_STORE_VIEWS) {
118+
if ($value === null || $value == self::ALL_STORE_VIEWS) {
119119
return null;
120120
}
121121
if ($value == '_deleted_') {

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Theme.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected function _drawOptions($options)
9494
$option['value']
9595
) . '</optgroup>';
9696
} else {
97-
$selected = $option['value'] == $value && !is_null($value) ? ' selected="selected"' : '';
97+
$selected = $option['value'] == $value && $value !== null ? ' selected="selected"' : '';
9898
$html .= '<option value="' . $option['value'] . '"' . $selected . '>' . $option['label'] . '</option>';
9999
}
100100
}
@@ -109,7 +109,7 @@ protected function _drawOptions($options)
109109
*/
110110
public function getCondition()
111111
{
112-
if (is_null($this->getValue())) {
112+
if ($this->getValue() === null) {
113113
return null;
114114
}
115115
$value = $this->getValue();

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(
4848
*/
4949
public function getValues()
5050
{
51-
if (is_null($this->_values)) {
51+
if ($this->_values === null) {
5252
$this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : [];
5353
}
5454
return $this->_values;

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function _getFormat()
4040
{
4141
$format = $this->getColumn()->getFormat();
4242
if (!$format) {
43-
if (is_null(self::$_format)) {
43+
if (self::$_format === null) {
4444
try {
4545
self::$_format = $this->_localeDate->getDateFormat(
4646
\IntlDateFormatter::MEDIUM

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Number.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Number extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstract
2626
protected function _getValue(\Magento\Framework\Object $row)
2727
{
2828
$data = parent::_getValue($row);
29-
if (!is_null($data)) {
29+
if ($data !== null) {
3030
$value = $data * 1;
3131
$sign = (bool)(int)$this->getColumn()->getShowNumberSign() && $value > 0 ? '+' : '';
3232
if ($sign) {

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Radio.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function _getValues()
5959
*/
6060
public function getValues()
6161
{
62-
if (is_null($this->_values)) {
62+
if ($this->_values === null) {
6363
$this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : [];
6464
}
6565
return $this->_values;

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function render(\Magento\Framework\Object $row)
5454
$html = '<select name="' . $this->escapeHtml($name) . '" ' . $this->getColumn()->getValidateClass() . '>';
5555
$value = $row->getData($this->getColumn()->getIndex());
5656
foreach ($this->_getOptions() as $val => $label) {
57-
$selected = $val == $value && !is_null($value) ? ' selected="selected"' : '';
57+
$selected = $val == $value && $value !== null ? ' selected="selected"' : '';
5858
$html .= '<option value="' . $this->escapeHtml($val) . '"' . $selected . '>';
5959
$html .= $this->escapeHtml($label) . '</option>';
6060
}

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Store.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function render(\Magento\Framework\Object $row)
9494
$skipEmptyStoresLabel = $this->_getShowEmptyStoresLabelFlag();
9595
$origStores = $row->getData($this->getColumn()->getIndex());
9696

97-
if (is_null($origStores) && $row->getStoreName()) {
97+
if ($origStores === null && $row->getStoreName()) {
9898
$scopes = [];
9999
foreach (explode("\n", $row->getStoreName()) as $k => $label) {
100100
$scopes[] = str_repeat('&nbsp;', $k * 3) . $label;
@@ -144,7 +144,7 @@ public function renderExport(\Magento\Framework\Object $row)
144144
$skipAllStoresLabel = $this->_getShowAllStoresLabelFlag();
145145
$origStores = $row->getData($this->getColumn()->getIndex());
146146

147-
if (is_null($origStores) && $row->getStoreName()) {
147+
if ($origStores === null && $row->getStoreName()) {
148148
$scopes = [];
149149
foreach (explode("\n", $row->getStoreName()) as $k => $label) {
150150
$scopes[] = str_repeat(' ', $k * 3) . $label;

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Text.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ public function _getValue(\Magento\Framework\Object $row)
3030
{
3131
$format = $this->getColumn()->getFormat() ? $this->getColumn()->getFormat() : null;
3232
$defaultValue = $this->getColumn()->getDefault();
33-
if (is_null($format)) {
33+
if ($format === null) {
3434
// If no format and it column not filtered specified return data as is.
3535
$data = parent::_getValue($row);
36-
$string = is_null($data) ? $defaultValue : $data;
36+
$string = $data === null ? $defaultValue : $data;
3737
return $this->escapeHtml($string);
3838
} elseif (preg_match_all($this->_variablePattern, $format, $matches)) {
3939
// Parsing of format string

app/code/Magento/Backend/Block/Widget/Grid/Container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function _construct()
5959
$this->_addButtonLabel = $this->_getData(self::PARAM_BUTTON_NEW);
6060
} else {
6161
// legacy logic to support all descendants
62-
if (is_null($this->_addButtonLabel)) {
62+
if ($this->_addButtonLabel === null) {
6363
$this->_addButtonLabel = __('Add New');
6464
}
6565
$this->_addNewButton();
@@ -68,7 +68,7 @@ protected function _construct()
6868
$this->_backButtonLabel = $this->_getData(self::PARAM_BUTTON_BACK);
6969
} else {
7070
// legacy logic
71-
if (is_null($this->_backButtonLabel)) {
71+
if ($this->_backButtonLabel === null) {
7272
$this->_backButtonLabel = __('Back');
7373
}
7474
}

app/code/Magento/Backend/Block/Widget/Grid/Extended.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ public function _exportIterateCollection($callback, array $args)
949949
$collection->setPageSize($this->_exportPageSize);
950950
$collection->setCurPage($page);
951951
$collection->load();
952-
if (is_null($count)) {
952+
if ($count === null) {
953953
$count = $collection->getSize();
954954
$lPage = $collection->getLastPageNumber();
955955
}

app/code/Magento/Backend/Block/Widget/Tabs.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function addTab($tabId, $tab)
127127
} else {
128128
throw new \Exception(__('Please correct the tab configuration and try again.'));
129129
}
130-
if (is_null($this->_tabs[$tabId]->getUrl())) {
130+
if ($this->_tabs[$tabId]->getUrl() === null) {
131131
$this->_tabs[$tabId]->setUrl('#');
132132
}
133133

@@ -138,7 +138,7 @@ public function addTab($tabId, $tab)
138138
$this->_tabs[$tabId]->setId($tabId);
139139
$this->_tabs[$tabId]->setTabId($tabId);
140140

141-
if (is_null($this->_activeTab)) {
141+
if ($this->_activeTab === null) {
142142
$this->_activeTab = $tabId;
143143
}
144144
if (true === $this->_tabs[$tabId]->getActive()) {
@@ -197,7 +197,7 @@ public function setActiveTab($tabId)
197197
)
198198
) {
199199
$this->_activeTab = $tabId;
200-
if (!is_null($this->_activeTab) && $tabId !== $this->_activeTab) {
200+
if ($this->_activeTab !== null && $tabId !== $this->_activeTab) {
201201
foreach ($this->_tabs as $id => $tab) {
202202
$tab->setActive($id === $tabId);
203203
}
@@ -326,7 +326,7 @@ public function getTabUrl($tab)
326326
}
327327
return '#';
328328
}
329-
if (!is_null($tab->getUrl())) {
329+
if ($tab->getUrl() !== null) {
330330
return $tab->getUrl();
331331
}
332332
return '#';

app/code/Magento/Backend/Helper/Dashboard/AbstractDashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract class AbstractDashboard extends \Magento\Framework\App\Helper\AbstractH
2929
*/
3030
public function getCollection()
3131
{
32-
if (is_null($this->_collection)) {
32+
if ($this->_collection === null) {
3333
$this->_initCollection();
3434
}
3535
return $this->_collection;

app/code/Magento/Backend/Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getPageHelpUrl()
9393
*/
9494
public function setPageHelpUrl($url = null)
9595
{
96-
if (is_null($url)) {
96+
if ($url === null) {
9797
$request = $this->_request;
9898
$frontModule = $request->getControllerModule();
9999
if (!$frontModule) {

app/code/Magento/Backend/Model/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function isLoggedIn()
207207
*/
208208
public static function throwException(Phrase $msg = null)
209209
{
210-
if (is_null($msg)) {
210+
if ($msg === null) {
211211
$msg = __('Authentication error occurred.');
212212
}
213213
throw new AuthenticationException($msg);

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function __construct(
103103
*/
104104
public function refreshAcl($user = null)
105105
{
106-
if (is_null($user)) {
106+
if ($user === null) {
107107
$user = $this->getUser();
108108
}
109109
if (!$user) {
@@ -197,7 +197,7 @@ public function prolong()
197197
*/
198198
public function isFirstPageAfterLogin()
199199
{
200-
if (is_null($this->_isFirstAfterLogin)) {
200+
if ($this->_isFirstAfterLogin === null) {
201201
$this->_isFirstAfterLogin = $this->getData('is_first_visit', true);
202202
}
203203
return $this->_isFirstAfterLogin;

app/code/Magento/Backend/Model/Menu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(\Psr\Log\LoggerInterface $logger, $pathInMenuStructu
4646
*/
4747
public function add(\Magento\Backend\Model\Menu\Item $item, $parentId = null, $index = null)
4848
{
49-
if (!is_null($parentId)) {
49+
if ($parentId !== null) {
5050
$parentItem = $this->get($parentId);
5151
if ($parentItem === null) {
5252
throw new \InvalidArgumentException("Item with identifier {$parentId} does not exist");
@@ -182,7 +182,7 @@ public function getFirstAvailable()
182182
if ($item->isAllowed() && !$item->isDisabled()) {
183183
if ($item->hasChildren()) {
184184
$result = $item->getChildren()->getFirstAvailable();
185-
if (false == is_null($result)) {
185+
if (false == ($result === null)) {
186186
break;
187187
}
188188
} else {

0 commit comments

Comments
 (0)