From a3b0739f2bf374fd0710e2081bfb86b6b589d84d Mon Sep 17 00:00:00 2001 From: Pawel Wasiluk Date: Thu, 19 Aug 2021 14:26:59 +0200 Subject: [PATCH] Psalm fix --- src/Api/Mailboxes.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Api/Mailboxes.php b/src/Api/Mailboxes.php index ecad77b..f93bfbb 100644 --- a/src/Api/Mailboxes.php +++ b/src/Api/Mailboxes.php @@ -29,12 +29,11 @@ class Mailboxes extends HttpApi * * @throws \Exception */ - public function create(string $domain, array $parameters) + public function create(string $domain, array $parameters = []) { Assert::stringNotEmpty($domain); - Assert::isArray($parameters); - Assert::keyExists($parameters ,'mailbox'); - Assert::keyExists($parameters ,'password'); + Assert::keyExists($parameters, 'mailbox'); + Assert::keyExists($parameters, 'password'); Assert::minLength($parameters['password'], self::MIN_PASSWORD_LENGTH); $response = $this->httpPost(sprintf('/v3/%s/mailboxes', $domain), $parameters); @@ -53,7 +52,6 @@ class Mailboxes extends HttpApi public function show(string $domain, array $parameters = []) { Assert::stringNotEmpty($domain); - Assert::isArray($parameters); $response = $this->httpGet(sprintf('/v3/%s/mailboxes', $domain), $parameters); @@ -63,7 +61,7 @@ class Mailboxes extends HttpApi /** * @param string $domain * @param string $mailbox - * @param array $parameters + * @param array $parameters * * @return UpdateResponse * @@ -73,7 +71,6 @@ class Mailboxes extends HttpApi { Assert::stringNotEmpty($domain); Assert::stringNotEmpty($mailbox); - Assert::isArray($parameters); $response = $this->httpPut(sprintf('/v3/%s/mailboxes/%s', $domain, $mailbox), $parameters);