From 3303f25bccc1da5497aeee0a1e0abbd263fc7db1 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 16 Mar 2020 13:11:15 +0000 Subject: [PATCH] add some php 7+ array type hints. --- model/AliasHandler.php | 2 +- model/FetchmailHandler.php | 2 +- model/MailboxHandler.php | 2 +- model/PFAHandler.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/model/AliasHandler.php b/model/AliasHandler.php index 1fdf2206..dfa39e0b 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -254,7 +254,7 @@ class AliasHandler extends PFAHandler { } } - protected function setmore($values) { + protected function setmore(array $values) { if ($this->new) { if ($this->struct['address']['display_in_form'] == 1) { # default mode - split off 'domain' field from 'address' # TODO: do this unconditional? list(/*NULL*/, $domain) = explode('@', $values['address']); diff --git a/model/FetchmailHandler.php b/model/FetchmailHandler.php index de584dd0..182f41bb 100644 --- a/model/FetchmailHandler.php +++ b/model/FetchmailHandler.php @@ -85,7 +85,7 @@ class FetchmailHandler extends PFAHandler { } - protected function setmore($values) { + protected function setmore(array $values) { # set domain based on the target mailbox if ($this->new || isset($values['mailbox'])) { list(/*NULL*/, $domain) = explode('@', $values['mailbox']); diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index f82c7e65..e4061900 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -273,7 +273,7 @@ class MailboxHandler extends PFAHandler { // Could perhaps also use _validate_local_part($new_value) { .... } - public function set($values) { + public function set(array $values) { // See: https://github.com/postfixadmin/postfixadmin/issues/282 - ensure the 'local_part' does not contain an @ sign. $ok = true; if (isset($values['local_part']) && strpos($values['local_part'], '@')) { diff --git a/model/PFAHandler.php b/model/PFAHandler.php index 5303f240..aaafddac 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -418,7 +418,7 @@ abstract class PFAHandler { * @return bool - true if all values are valid, otherwise false * error messages (if any) are stored in $this->errormsg */ - public function set($values) { + public function set(array $values) { if (!$this->can_edit) { $this->errormsg[] = Config::Lang_f('edit_not_allowed', $this->label); return false; @@ -521,7 +521,7 @@ abstract class PFAHandler { * can be used to update additional columns etc. * hint: modify $this->values and $this->errormsg directly as needed */ - protected function setmore($values) { + protected function setmore(array $values) { # do nothing }