From 4f62d52fd7740e96e1837247880219ad58c14b77 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 19 Apr 2020 00:12:11 +0200 Subject: [PATCH] src: Fix some more issues noticed by Psalm --- src/controllers/About.php | 2 +- src/controllers/Opml/Import.php | 8 +++++--- src/controllers/Opml/ImportPage.php | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/controllers/About.php b/src/controllers/About.php index 760fc71f12..701e418e1b 100644 --- a/src/controllers/About.php +++ b/src/controllers/About.php @@ -61,6 +61,6 @@ public function about(Base $f3) { ], ]; - echo $this->view->jsonSuccess($configuration); + $this->view->jsonSuccess($configuration); } } diff --git a/src/controllers/Opml/Import.php b/src/controllers/Opml/Import.php index d9f641e118..ebeefb1b28 100644 --- a/src/controllers/Opml/Import.php +++ b/src/controllers/Opml/Import.php @@ -47,6 +47,8 @@ public function __construct(Authentication $authentication, Logger $logger, \dao * html * * @note Borrows from controllers/Sources.php:write + * + * @return void */ public function add() { $this->authentication->needsLoggedIn(); @@ -78,8 +80,8 @@ public function add() { // show errors if (count($errors) > 0) { http_response_code(202); - $messages = 'The following feeds could not be imported:'; - $messages += $errors; + $messages[] = 'The following feeds could not be imported:'; + $messages = array_merge($messages, $errors); } else { // On success bring them back to their subscription list http_response_code(200); $amount = count($this->imported); @@ -149,7 +151,7 @@ private function processGroup(SimpleXMLElement $xml, array $tags = []) { * @param SimpleXMLElement $xml xml feed entry for item * @param array $tags of the entry * - * @return bool|string true on success or item title on error + * @return true|string true on success or item title on error */ private function addSubscription(SimpleXMLElement $xml, array $tags) { // OPML Required attributes: text, xmlUrl, type diff --git a/src/controllers/Opml/ImportPage.php b/src/controllers/Opml/ImportPage.php index de2c573558..11ec42152e 100644 --- a/src/controllers/Opml/ImportPage.php +++ b/src/controllers/Opml/ImportPage.php @@ -20,6 +20,8 @@ public function __construct(Authentication $authentication) { /** * Shows a simple html form * html + * + * @return void */ public function show() { $this->authentication->needsLoggedIn();