Skip to content

Commit

Permalink
Compatible PHP8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
magiccart committed Nov 10, 2022
1 parent e64fde3 commit 1e19b52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,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_Magicslider::magicslider_$action");
}
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Index/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function execute()
}
unset($images[$key]);
} else {
if(!preg_match ( '/^\/mobile\/*/', $image['file'])){
if(!preg_match ( '/^\/mobile\/*/', (string) $image['file'])){
$images[$key]['file']= '/mobile' . $image['file'];
}

Expand Down
4 changes: 2 additions & 2 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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 @@ -47,7 +47,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

0 comments on commit 1e19b52

Please sign in to comment.