From 619cb730ef3967bd96704b3b8663c4a4c09752a2 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 12:18:03 +0000 Subject: [PATCH 1/2] Fix possible falsy return of getopt() --- .phpstan.neon | 3 ++- bin/daemon.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.phpstan.neon b/.phpstan.neon index 687b9d2f98..0aad06f8a6 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -7,8 +7,9 @@ parameters: paths: - addon/ - - src/ + - bin/daemon.php - index.php + - src/ excludePaths: analyse: diff --git a/bin/daemon.php b/bin/daemon.php index 83774c7a2d..06e8574cae 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -31,4 +31,4 @@ $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies. $app = \Friendica\App::fromDice($dice); -$app->processDaemon($_SERVER['argv'] ?? [], $options); +$app->processDaemon($_SERVER['argv'] ?? [], $options ?: []); From 5ca887d839a3aa022740046ecf6aa13c57b352ae Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 12:22:39 +0000 Subject: [PATCH 2/2] Check more bin files with PHPStan --- .phpstan.neon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.phpstan.neon b/.phpstan.neon index 0aad06f8a6..918ebe6eb8 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -7,6 +7,8 @@ parameters: paths: - addon/ + - bin/auth_ejabberd.php + - bin/console.php - bin/daemon.php - index.php - src/