Skip to content

Commit

Permalink
Compatible PHP 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
magiccart committed Nov 10, 2022
1 parent 6f8d584 commit 0c72e76
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Block/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function drawMainMenu()
$this->extData[$ext->getCatId()] = $ext->getData();
}
$last = count($categories);
$dropdownIds = explode(',', $this->_sysCfg->general['dropdown'] ?? '');
$dropdownIds = explode(',', (string) $this->_sysCfg->general['dropdown']);
$counter = 1;
$this->removeChildrenWithoutActiveParent($categories, 0);
foreach ($categories as $catTop){
Expand Down Expand Up @@ -451,7 +451,7 @@ private function getCategoryAsArray($category, $currentCategory, $isParentActive
'name' => $category->getName(),
'id' => 'category-node-' . $categoryId,
'url' => $this->_catalogCategory->getCategoryUrl($category),
'has_active' => in_array((string)$categoryId, explode('/', (string)$currentCategory->getPath()), true),
'has_active' => in_array((string)$categoryId, explode('/', (string) $currentCategory->getPath()), true),
'is_active' => $categoryId == $currentCategory->getId(),
'is_category' => true,
'is_parent_active' => $isParentActive,
Expand Down
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public function __construct(
protected function _isAllowed()
{
$namespace = (new \ReflectionObject($this))->getNamespaceName();
$string = strtolower(str_replace(__NAMESPACE__ . '\\','', $namespace));
$action = explode('\\', $string);
$string = strtolower(str_replace(__NAMESPACE__ . '\\','', (string) $namespace));
$action = explode('\\', (string) $string);
$action = array_shift($action);
return $this->_authorization->isAllowed("Magiccart_Magicmenu::magicmenu_$action");
}
Expand Down
4 changes: 2 additions & 2 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
{
parent::__construct($context);
$this->moduleManager = $moduleManager;
$module = strtolower(str_replace('Magiccart_', '', $this->_getModuleName()));
$module = strtolower(str_replace('Magiccart_', '', (string) $this->_getModuleName()));
$this->configModule = $this->getConfig($module);

}
Expand All @@ -43,7 +43,7 @@ public function getConfigModule($cfg='', $value=null)
{
$values = $this->configModule;
if( !$cfg ) return $values;
$config = explode('/', $cfg);
$config = explode('/', (string) $cfg);
$end = count($config) - 1;
foreach ($config as $key => $vl) {
if( isset($values[$vl]) ){
Expand Down
4 changes: 2 additions & 2 deletions view/frontend/templates/aio-topmenu.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $drawExtraMenu = $menu['extraCat'] ? $extraHtml : '';
$vdrawExtraMenu = $vmenu['extraCat'] ? $extraHtml : '';
if($vmenu['mainCat']){
$vdesktop = $menuHtml['desktop'];
$vids = explode(',', $vmenu['notIncludeNav']);
$vids = explode(',', (string) $vmenu['notIncludeNav']);
foreach ($vids as $id) { unset($vdesktop[$id]); }
$vdrawMainMenu = implode("\n", $vdesktop);
}
Expand Down Expand Up @@ -71,7 +71,7 @@ $drawExtraMenu = $menu['extraCat'] ? $extraHtml : '';
<?php
if($menu['mainCat']){
$desktop = $menuHtml['desktop'];
$ids = explode(',', $menu['notIncludeNav']);
$ids = explode(',', (string) $menu['notIncludeNav']);
foreach ($ids as $id) { unset($desktop[$id]); }
$drawMainMenu = implode("\n", $desktop);
}
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/templates/topmenu.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if( !$menu['enabled']){
$menuHtml = $this->drawMainMenu();
$mobileMenu = $menuHtml['mobile'];
$desktop = $menuHtml['desktop'];
$ids = explode(',', $menu['notIncludeNav']);
$ids = explode(',', (string) $menu['notIncludeNav']);
foreach ($ids as $id) { unset($desktop[$id]); }
// drawHomeMenu
$drawHomeMenu = $menu['home'] ? $this->drawHomeMenu() : '';
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/templates/vmenu.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(!$vmenu['enabled']) return;
$menuHtml = $this->drawMainMenu();
$mobileMenu = $menuHtml['mobile'];
$desktop = $menuHtml['desktop'];
$ids = explode(',', $vmenu['notIncludeNav']);
$ids = explode(',', (string) $vmenu['notIncludeNav']);
foreach ($ids as $id) { unset($desktop[$id]); }
// drawHomeMenu
$drawHomeMenu = $vmenu['home'] ? $this->drawHomeMenu() : '';
Expand Down

0 comments on commit 0c72e76

Please sign in to comment.