remove unused nullsafe check

This commit is contained in:
Jean-Christian Paul Denis 2023-08-15 21:51:55 +02:00
parent 5192dea04a
commit b3edda6cc8
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
4 changed files with 6 additions and 7 deletions

View File

@ -10,7 +10,7 @@
* @copyright Jean-Christian Denis * @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
if (!defined('DC_RC_PATH') || is_null(dcCore::app()->auth)) { if (!defined('DC_RC_PATH')) {
return null; return null;
} }

View File

@ -25,7 +25,7 @@ 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()->blog) && !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog)
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([ && dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
My::PERMISSION_TEMPLATOR, My::PERMISSION_TEMPLATOR,
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
@ -41,7 +41,7 @@ class Backend extends dcNsProcess
} }
// nullsafe // nullsafe
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

@ -32,7 +32,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)
&& !is_null(dcCore::app()->blog) && !is_null(dcCore::app()->blog)
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([ && dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
@ -49,7 +48,7 @@ class Manage extends dcNsProcess
} }
// nullsafe // nullsafe
if (is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl)) { if (is_null(dcCore::app()->blog)) {
return false; return false;
} }
@ -146,7 +145,7 @@ class Manage extends dcNsProcess
} }
// nullsafe // nullsafe
if (is_null(dcCore::app()->auth) || is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl) || is_null(dcCore::app()->auth->user_prefs)) { if (is_null(dcCore::app()->blog)) {
return; return;
} }

View File

@ -24,7 +24,7 @@ class Pager
{ {
public static function line(File $f, int $i): string public static function line(File $f, int $i): string
{ {
if (is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl)) { if (is_null(dcCore::app()->blog)) {
return ''; return '';
} }