Skip to content

Commit

Permalink
Merge branch 'develop' into MAGETWO-35266-Update-fails-trying-to-recr…
Browse files Browse the repository at this point in the history
…eate-tables
  • Loading branch information
Bryant Luk committed Mar 18, 2015
2 parents 051c1ce + b456cd1 commit 28cf7e4
Show file tree
Hide file tree
Showing 529 changed files with 1,273 additions and 975 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/Model/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Authorization/Model/CompositeUserContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/App/AbstractAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Block/Dashboard/Bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Block/Dashboard/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Block/Store/Switcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Backend/Block/Widget/Grid/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<option value="' . $this->escapeHtml(
$option['value']
) . '"' . $selected . '>' . $this->escapeHtml(
Expand Down Expand Up @@ -88,7 +88,7 @@ public function getHtml()
*/
public function getCondition()
{
if (is_null($this->getValue())) {
if ($this->getValue() === null) {
return null;
}
return ['eq' => $this->getValue()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function getHtml()
public function getCondition()
{
$value = $this->getValue();
if (is_null($value) || $value == self::ALL_STORE_VIEWS) {
if ($value === null || $value == self::ALL_STORE_VIEWS) {
return null;
}
if ($value == '_deleted_') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected function _drawOptions($options)
$option['value']
) . '</optgroup>';
} else {
$selected = $option['value'] == $value && !is_null($value) ? ' selected="selected"' : '';
$selected = $option['value'] == $value && $value !== null ? ' selected="selected"' : '';
$html .= '<option value="' . $option['value'] . '"' . $selected . '>' . $option['label'] . '</option>';
}
}
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function render(\Magento\Framework\Object $row)
$html = '<select name="' . $this->escapeHtml($name) . '" ' . $this->getColumn()->getValidateClass() . '>';
$value = $row->getData($this->getColumn()->getIndex());
foreach ($this->_getOptions() as $val => $label) {
$selected = $val == $value && !is_null($value) ? ' selected="selected"' : '';
$selected = $val == $value && $value !== null ? ' selected="selected"' : '';
$html .= '<option value="' . $this->escapeHtml($val) . '"' . $selected . '>';
$html .= $this->escapeHtml($label) . '</option>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function render(\Magento\Framework\Object $row)
$skipEmptyStoresLabel = $this->_getShowEmptyStoresLabelFlag();
$origStores = $row->getData($this->getColumn()->getIndex());

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

if (is_null($origStores) && $row->getStoreName()) {
if ($origStores === null && $row->getStoreName()) {
$scopes = [];
foreach (explode("\n", $row->getStoreName()) as $k => $label) {
$scopes[] = str_repeat(' ', $k * 3) . $label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public function _getValue(\Magento\Framework\Object $row)
{
$format = $this->getColumn()->getFormat() ? $this->getColumn()->getFormat() : null;
$defaultValue = $this->getColumn()->getDefault();
if (is_null($format)) {
if ($format === null) {
// If no format and it column not filtered specified return data as is.
$data = parent::_getValue($row);
$string = is_null($data) ? $defaultValue : $data;
$string = $data === null ? $defaultValue : $data;
return $this->escapeHtml($string);
} elseif (preg_match_all($this->_variablePattern, $format, $matches)) {
// Parsing of format string
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Backend/Block/Widget/Grid/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function _construct()
$this->_addButtonLabel = $this->_getData(self::PARAM_BUTTON_NEW);
} else {
// legacy logic to support all descendants
if (is_null($this->_addButtonLabel)) {
if ($this->_addButtonLabel === null) {
$this->_addButtonLabel = __('Add New');
}
$this->_addNewButton();
Expand All @@ -68,7 +68,7 @@ protected function _construct()
$this->_backButtonLabel = $this->_getData(self::PARAM_BUTTON_BACK);
} else {
// legacy logic
if (is_null($this->_backButtonLabel)) {
if ($this->_backButtonLabel === null) {
$this->_backButtonLabel = __('Back');
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Block/Widget/Grid/Extended.php
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ public function _exportIterateCollection($callback, array $args)
$collection->setPageSize($this->_exportPageSize);
$collection->setCurPage($page);
$collection->load();
if (is_null($count)) {
if ($count === null) {
$count = $collection->getSize();
$lPage = $collection->getLastPageNumber();
}
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Backend/Block/Widget/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function addTab($tabId, $tab)
} else {
throw new \Exception(__('Please correct the tab configuration and try again.'));
}
if (is_null($this->_tabs[$tabId]->getUrl())) {
if ($this->_tabs[$tabId]->getUrl() === null) {
$this->_tabs[$tabId]->setUrl('#');
}

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

if (is_null($this->_activeTab)) {
if ($this->_activeTab === null) {
$this->_activeTab = $tabId;
}
if (true === $this->_tabs[$tabId]->getActive()) {
Expand Down Expand Up @@ -197,7 +197,7 @@ public function setActiveTab($tabId)
)
) {
$this->_activeTab = $tabId;
if (!is_null($this->_activeTab) && $tabId !== $this->_activeTab) {
if ($this->_activeTab !== null && $tabId !== $this->_activeTab) {
foreach ($this->_tabs as $id => $tab) {
$tab->setActive($id === $tabId);
}
Expand Down Expand Up @@ -326,7 +326,7 @@ public function getTabUrl($tab)
}
return '#';
}
if (!is_null($tab->getUrl())) {
if ($tab->getUrl() !== null) {
return $tab->getUrl();
}
return '#';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract class AbstractDashboard extends \Magento\Framework\App\Helper\AbstractH
*/
public function getCollection()
{
if (is_null($this->_collection)) {
if ($this->_collection === null) {
$this->_initCollection();
}
return $this->_collection;
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function getPageHelpUrl()
*/
public function setPageHelpUrl($url = null)
{
if (is_null($url)) {
if ($url === null) {
$request = $this->_request;
$frontModule = $request->getControllerModule();
if (!$frontModule) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Model/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function isLoggedIn()
*/
public static function throwException(Phrase $msg = null)
{
if (is_null($msg)) {
if ($msg === null) {
$msg = __('Authentication error occurred.');
}
throw new AuthenticationException($msg);
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Backend/Model/Auth/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function __construct(
*/
public function refreshAcl($user = null)
{
if (is_null($user)) {
if ($user === null) {
$user = $this->getUser();
}
if (!$user) {
Expand Down Expand Up @@ -197,7 +197,7 @@ public function prolong()
*/
public function isFirstPageAfterLogin()
{
if (is_null($this->_isFirstAfterLogin)) {
if ($this->_isFirstAfterLogin === null) {
$this->_isFirstAfterLogin = $this->getData('is_first_visit', true);
}
return $this->_isFirstAfterLogin;
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Backend/Model/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct(\Psr\Log\LoggerInterface $logger, $pathInMenuStructu
*/
public function add(\Magento\Backend\Model\Menu\Item $item, $parentId = null, $index = null)
{
if (!is_null($parentId)) {
if ($parentId !== null) {
$parentItem = $this->get($parentId);
if ($parentItem === null) {
throw new \InvalidArgumentException("Item with identifier {$parentId} does not exist");
Expand Down Expand Up @@ -182,7 +182,7 @@ public function getFirstAvailable()
if ($item->isAllowed() && !$item->isDisabled()) {
if ($item->hasChildren()) {
$result = $item->getChildren()->getFirstAvailable();
if (false == is_null($result)) {
if (false == ($result === null)) {
break;
}
} else {
Expand Down
Loading

0 comments on commit 28cf7e4

Please sign in to comment.