From f9cd8787cb32ae6376873ebdd9a3715979ece95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Wed, 7 Jun 2023 08:50:29 +0200 Subject: [PATCH] fix: psalm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- lib/RecursiveDirectoryIteratorWithoutData.php | 8 +++++++- lib/Updater.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/RecursiveDirectoryIteratorWithoutData.php b/lib/RecursiveDirectoryIteratorWithoutData.php index 55298bc0..3ed5bb4b 100644 --- a/lib/RecursiveDirectoryIteratorWithoutData.php +++ b/lib/RecursiveDirectoryIteratorWithoutData.php @@ -31,6 +31,12 @@ public function accept(): bool { 'data', '..', ]; - return !(in_array($this->current()->getFilename(), $excludes, true) || $this->current()->isDir()); + + $current = $this->current(); + if (!$current) { + return false; + } + + return !(in_array($current->getFilename(), $excludes, true) || $current->isDir()); } } diff --git a/lib/Updater.php b/lib/Updater.php index b556ac19..deac432a 100644 --- a/lib/Updater.php +++ b/lib/Updater.php @@ -440,7 +440,7 @@ public function createBackup() { $this->silentLog('[info] end of createBackup()'); } - private function getChangelogURL($versionString) { + private function getChangelogURL(string $versionString) { $this->silentLog('[info] getChangelogURL()'); $changelogWebsite = 'https://nextcloud.com/changelog/'; $changelogURL = $changelogWebsite . '#' . str_replace('.', '-', $versionString);