remove uninitialized check

This commit is contained in:
Jean-Christian Denis 2023-07-16 01:19:27 +02:00
parent 6e99c71660
commit 348beb0c44
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
5 changed files with 5 additions and 8 deletions

View file

@ -30,7 +30,6 @@ class Backend extends dcNsProcess
public static function init(): bool public static function init(): bool
{ {
static::$init = defined('DC_CONTEXT_ADMIN') static::$init = defined('DC_CONTEXT_ADMIN')
&& !is_null(dcCore::app()->auth)
&& dcCore::app()->auth->isSuperAdmin(); && dcCore::app()->auth->isSuperAdmin();
return static::$init; return static::$init;
@ -42,7 +41,7 @@ class Backend extends dcNsProcess
return false; return false;
} }
if (is_null(dcCore::app()->auth) || is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl)) { if (is_null(dcCore::app()->blog)) {
return false; return false;
} }

View file

@ -39,7 +39,6 @@ class Config extends dcNsProcess
public static function init(): bool public static function init(): bool
{ {
static::$init = defined('DC_CONTEXT_ADMIN') static::$init = defined('DC_CONTEXT_ADMIN')
&& !is_null(dcCore::app()->auth)
&& dcCore::app()->auth->isSuperAdmin(); && dcCore::app()->auth->isSuperAdmin();
return static::$init; return static::$init;
@ -55,7 +54,7 @@ class Config extends dcNsProcess
return true; return true;
} }
if (is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl)) { if (is_null(dcCore::app()->blog)) {
return false; return false;
} }
@ -88,7 +87,7 @@ class Config extends dcNsProcess
return; return;
} }
if (is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl)) { if (is_null(dcCore::app()->blog)) {
return; return;
} }

View file

@ -54,7 +54,6 @@ class Manage extends dcNsProcess
public static function init(): bool public static function init(): bool
{ {
static::$init = defined('DC_CONTEXT_ADMIN') static::$init = defined('DC_CONTEXT_ADMIN')
&& !is_null(dcCore::app()->auth)
&& dcCore::app()->auth->isSuperAdmin(); && dcCore::app()->auth->isSuperAdmin();
return static::$init; return static::$init;

View file

@ -162,7 +162,7 @@ class CssHeader extends Task
public function openModule(): ?bool public function openModule(): ?bool
{ {
if (is_null(dcCore::app()->auth)) { if (!isset(dcCore::app()->auth)) {
$this->warning->add(__('Auth is not set')); $this->warning->add(__('Auth is not set'));
return null; return null;

View file

@ -161,7 +161,7 @@ class PhpHeader extends Task
public function openModule(): ?bool public function openModule(): ?bool
{ {
if (is_null(dcCore::app()->auth)) { if (!isset(dcCore::app()->auth)) {
$this->warning->add(__('Auth is not set')); $this->warning->add(__('Auth is not set'));
return null; return null;