From e8f27969a3a1be7461efc3ece169605fec4c5f43 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sun, 21 Jun 2020 16:44:43 +0100 Subject: [PATCH] psalm fixes --- model/AdminHandler.php | 2 +- model/AliasHandler.php | 3 ++- model/AliasdomainHandler.php | 3 ++- model/DomainHandler.php | 2 +- model/FetchmailHandler.php | 9 +++++---- model/PFAHandler.php | 8 ++++---- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/model/AdminHandler.php b/model/AdminHandler.php index 418627eb..9f898d65 100644 --- a/model/AdminHandler.php +++ b/model/AdminHandler.php @@ -183,7 +183,7 @@ class AdminHandler extends PFAHandler { } /** - * @return true on success false on failure + * @return bool */ public function delete() { if (! $this->view()) { diff --git a/model/AliasHandler.php b/model/AliasHandler.php index 6aafe86a..387e9b2c 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -440,6 +440,7 @@ class AliasHandler extends PFAHandler { * Returns the vacation alias for this user. * i.e. if this user's username was roger@example.com, and the autoreply domain was set to * autoreply.fish.net in config.inc.php we'd return roger#example.com@autoreply.fish.net + * * @return string an email alias. */ protected function getVacationAlias() { @@ -448,7 +449,7 @@ class AliasHandler extends PFAHandler { } /** - * @return true on success false on failure + * @return boolean */ public function delete() { if (! $this->view()) { diff --git a/model/AliasdomainHandler.php b/model/AliasdomainHandler.php index 6b28af25..e2f3cb81 100644 --- a/model/AliasdomainHandler.php +++ b/model/AliasdomainHandler.php @@ -100,7 +100,7 @@ class AliasdomainHandler extends PFAHandler { /** - * @return true on success false on failure + * @return boolean */ public function delete() { if (! $this->view()) { @@ -118,6 +118,7 @@ class AliasdomainHandler extends PFAHandler { /** * validate target_domain field - it must be != $this->id to avoid a loop + * @return boolean */ protected function _validate_target_domain($field, $val) { if ($val == $this->id) { diff --git a/model/DomainHandler.php b/model/DomainHandler.php index 40b0bb7e..c919c3b9 100644 --- a/model/DomainHandler.php +++ b/model/DomainHandler.php @@ -191,7 +191,7 @@ class DomainHandler extends PFAHandler { } /** - * @return true on success false on failure + * @return bool */ public function delete() { # TODO: check for _can_delete instead diff --git a/model/FetchmailHandler.php b/model/FetchmailHandler.php index 182f41bb..163ecae9 100644 --- a/model/FetchmailHandler.php +++ b/model/FetchmailHandler.php @@ -107,7 +107,7 @@ class FetchmailHandler extends PFAHandler { /** - * @return true on success false on failure + * @return boolean */ public function delete() { if (! $this->view()) { @@ -124,7 +124,7 @@ class FetchmailHandler extends PFAHandler { } - /* + /** * validate src_server - must be non-empty and survive check_domain() */ protected function _validate_src_server($field, $val) { @@ -142,7 +142,7 @@ class FetchmailHandler extends PFAHandler { } } - /* + /** * validate src_user and src_password - must be non-empty * (we can't assume anything about valid usernames and passwords on remote * servers, so the validation can't be more strict) @@ -154,6 +154,7 @@ class FetchmailHandler extends PFAHandler { } return true; } + protected function _validate_src_password($field, $val) { if ($val == '') { $this->errormsg[$field] = Config::lang('pFetchmail_password_missing'); @@ -162,7 +163,7 @@ class FetchmailHandler extends PFAHandler { return true; } - /* + /** * validate poll interval - must be numeri and > 0 */ protected function _validate_poll_time($field, $val) { diff --git a/model/PFAHandler.php b/model/PFAHandler.php index aaafddac..4e7a5a2a 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -790,11 +790,11 @@ abstract class PFAHandler { /** * get a list of one or more items with all values - * @param array or string $condition - see read_from_db for details + * @param array|string $condition - see read_from_db for details * WARNING: will be changed to array only in the future, with an option to include a raw string inside the array - * @param array - modes to use if $condition is an array - see read_from_db for details - * @param integer limit - maximum number of rows to return - * @param integer offset - number of first row to return + * @param array $searchmode - modes to use if $condition is an array - see read_from_db for details + * @param int $limit - maximum number of rows to return + * @param int $offset - number of first row to return * @return bool - always true, no need to check ;-) (if $result is not an array, getList die()s) * The data is stored in $this->result (as array of rows, each row is an associative array of column => value) */