mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 23:03:25 +09:00
Fix misc warnings in PHP 8.0
This commit is contained in:
parent
b5cdd1212e
commit
855e12a5de
7 changed files with 40 additions and 20 deletions
|
|
@ -1616,7 +1616,7 @@ class Context
|
|||
}
|
||||
|
||||
// If $args_list contains one array, reset existing parameters and use keys & values from $args_list.
|
||||
if (is_array($args_list[0]) && count($args_list) == 1)
|
||||
if (count($args_list) == 1 && is_array($args_list[0]))
|
||||
{
|
||||
$get_vars = array();
|
||||
foreach ($args_list[0] as $key => $val)
|
||||
|
|
@ -1653,14 +1653,14 @@ class Context
|
|||
unset($get_vars['vid']);
|
||||
|
||||
// for compatibility to lower versions
|
||||
$act = $get_vars['act'];
|
||||
$act = $get_vars['act'] ?? null;
|
||||
$act_alias = array(
|
||||
'dispMemberFriend' => 'dispCommunicationFriend',
|
||||
'dispMemberMessages' => 'dispCommunicationMessages',
|
||||
'dispDocumentAdminManageDocument' => 'dispDocumentManageDocument',
|
||||
'dispModuleAdminSelectList' => 'dispModuleSelectList'
|
||||
);
|
||||
if(isset($act_alias[$act]))
|
||||
if($act && isset($act_alias[$act]))
|
||||
{
|
||||
$get_vars['act'] = $act_alias[$act];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,11 +248,11 @@ class BaseObject
|
|||
* Method to retrieve a corresponding value to a given key
|
||||
*
|
||||
* @param string $key
|
||||
* @return string Returns value to a given key
|
||||
* @return mixed Returns value to a given key
|
||||
*/
|
||||
public function get($key)
|
||||
{
|
||||
return $this->variables[$key];
|
||||
return $this->variables[$key] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class TemplateHandler
|
|||
Rhymix\Framework\Storage::delete($tmpfilename);
|
||||
}
|
||||
|
||||
if($__templatehandler_root_tpl == $this->file)
|
||||
if(isset($__templatehandler_root_tpl) && $__templatehandler_root_tpl == $this->file)
|
||||
{
|
||||
$__templatehandler_root_tpl = null;
|
||||
}
|
||||
|
|
@ -816,13 +816,18 @@ class TemplateHandler
|
|||
case 'scss':
|
||||
if($doUnload)
|
||||
{
|
||||
$result = "Context::unloadFile('{$attr['target']}','{$attr['targetie']}','{$attr['media']}');";
|
||||
$result = vsprintf("Context::unloadFile('%s', '%s', '%s';", [
|
||||
$attr['target'] ?? '', $attr['targetie'] ?? '', $attr['media'] ?? '',
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$metafile = $attr['target'];
|
||||
$metavars = ($attr['vars'] ? self::_replaceVar($attr['vars']) : '');
|
||||
$result = "\$__tmp=array('{$attr['target']}','{$attr['media']}','{$attr['targetie']}','{$attr['index']}'," . ($attr['vars'] ? self::_replaceVar($attr['vars']) : 'array()') . ");Context::loadFile(\$__tmp);unset(\$__tmp);";
|
||||
$metafile = isset($attr['target']) ? $attr['target'] : '';
|
||||
$metavars = isset($attr['vars']) ? ($attr['vars'] ? self::_replaceVar($attr['vars']) : '') : '';
|
||||
$result = vsprintf("Context::loadFile(['%s', '%s', '%s', '%s', %s]);", [
|
||||
$attr['target'] ?? '', $attr['media'] ?? '', $attr['targetie'] ?? '', $attr['index'] ?? '',
|
||||
isset($attr['vars']) ? ($attr['vars'] ? self::_replaceVar($attr['vars']) : '[]') : '[]',
|
||||
]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue