remove unused nullsafe check

This commit is contained in:
Jean-Christian 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 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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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 '';
}