From 4759c624328c96f086c1068dc981f5f07f0f7e54 Mon Sep 17 00:00:00 2001 From: Boy132 Date: Thu, 7 Aug 2025 11:56:51 +0200 Subject: [PATCH] replace null checks --- app/Models/Plugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/Plugin.php b/app/Models/Plugin.php index 55bf96400..e28b5d274 100644 --- a/app/Models/Plugin.php +++ b/app/Models/Plugin.php @@ -191,7 +191,7 @@ class Plugin extends Model implements HasPluginSettings public function shouldLoadPanel(string $panelId): bool { - return !$this->isDisabled() && $this->isInstalled() && !$this->isIncompatible() && ($this->panels === null || in_array($panelId, explode(',', $this->panels))); + return !$this->isDisabled() && $this->isInstalled() && !$this->isIncompatible() && (!$this->panels || in_array($panelId, explode(',', $this->panels))); } public function canEnable(): bool @@ -233,12 +233,12 @@ class Plugin extends Model implements HasPluginSettings { $panelVersion = config('app.version', 'canary'); - return $this->panel_version === null || $panelVersion === 'canary' || version_compare($this->panel_version, $panelVersion, $this->isPanelVersionStrict() ? '=' : '>='); + return !$this->panel_version || $panelVersion === 'canary' || version_compare($this->panel_version, $panelVersion, $this->isPanelVersionStrict() ? '=' : '>='); } public function isPanelVersionStrict(): bool { - if ($this->panel_version === null) { + if (!$this->panel_version) { return false; } @@ -258,7 +258,7 @@ class Plugin extends Model implements HasPluginSettings /** @return null|array */ private function getUpdateData(): ?array { - if ($this->update_url === null) { + if (!$this->update_url) { return null; }