Fix PHP8 warnings
This commit is contained in:
parent
8430605f6c
commit
84f10a366b
1 changed files with 7 additions and 7 deletions
|
@ -132,9 +132,9 @@ abstract class Base
|
||||||
|
|
||||||
$data[$key] = array(
|
$data[$key] = array(
|
||||||
'type' => $p['type'],
|
'type' => $p['type'],
|
||||||
'editable' => $p['editable'],
|
'editable' => $p['editable'] ?? false,
|
||||||
'hidden' => $p['hidden'],
|
'hidden' => $p['hidden'] ?? false,
|
||||||
'label' => $p['label'],
|
'label' => $p['label'] ?? '',
|
||||||
'value' => $this->get($key, $force),
|
'value' => $this->get($key, $force),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ abstract class Base
|
||||||
$value = $this->get_user_prop($key);
|
$value = $this->get_user_prop($key);
|
||||||
|
|
||||||
// generate property value
|
// generate property value
|
||||||
if (!isset($value) && $force && $this->user_settings[$key]['generator']) {
|
if (!isset($value) && $force && !empty($this->user_settings[$key]['generator'])) {
|
||||||
$func = $this->user_settings[$key]['generator'];
|
$func = $this->user_settings[$key]['generator'];
|
||||||
if (is_string($func) && !is_callable($func)) {
|
if (is_string($func) && !is_callable($func)) {
|
||||||
$func = array($this, $func);
|
$func = array($this, $func);
|
||||||
|
@ -220,7 +220,7 @@ abstract class Base
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$value = $this->props[$key];
|
$value = $this->props[$key] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
@ -300,7 +300,7 @@ abstract class Base
|
||||||
$this->user_props = (array)$this->storage->read($this->id);
|
$this->user_props = (array)$this->storage->read($this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->user_props[$key];
|
return $this->user_props[$key] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -308,7 +308,7 @@ abstract class Base
|
||||||
*/
|
*/
|
||||||
protected function set_user_prop($key, $value)
|
protected function set_user_prop($key, $value)
|
||||||
{
|
{
|
||||||
$this->pending_changes |= ($this->user_props[$key] !== $value);
|
$this->pending_changes |= (($this->user_props[$key] ?? null) !== $value);
|
||||||
$this->user_props[$key] = $value;
|
$this->user_props[$key] = $value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue