From b3edda6cc8a5cb6c82509bdb54ee86b98a78c953 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Tue, 15 Aug 2023 21:51:55 +0200 Subject: [PATCH] remove unused nullsafe check --- _define.php | 2 +- src/Backend.php | 4 ++-- src/Manage.php | 5 ++--- src/Pager.php | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/_define.php b/_define.php index 4929593..32d7172 100644 --- a/_define.php +++ b/_define.php @@ -10,7 +10,7 @@ * @copyright Jean-Christian Denis * @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; } diff --git a/src/Backend.php b/src/Backend.php index 1a19fb2..245a9b4 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -25,7 +25,7 @@ class Backend extends dcNsProcess public static function init(): bool { 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([ My::PERMISSION_TEMPLATOR, dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, @@ -41,7 +41,7 @@ class Backend extends dcNsProcess } // 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; } diff --git a/src/Manage.php b/src/Manage.php index bba5483..8daaf27 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -32,7 +32,6 @@ class Manage extends dcNsProcess public static function init(): bool { static::$init == defined('DC_CONTEXT_ADMIN') - && !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog) && dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([ dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, @@ -49,7 +48,7 @@ class Manage extends dcNsProcess } // nullsafe - if (is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl)) { + if (is_null(dcCore::app()->blog)) { return false; } @@ -146,7 +145,7 @@ class Manage extends dcNsProcess } // 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; } diff --git a/src/Pager.php b/src/Pager.php index cc00e15..866484d 100644 --- a/src/Pager.php +++ b/src/Pager.php @@ -24,7 +24,7 @@ class Pager { 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 ''; }