From ef8b28443434803546b5752e1f7c005ce649f4f4 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 4 Jan 2024 16:25:36 +0200 Subject: [PATCH] cs --- .../Espo/Core/Mail/Account/GroupAccount/Service.php | 8 ++------ .../Core/Mail/Account/PersonalAccount/Service.php | 12 +++--------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/application/Espo/Core/Mail/Account/GroupAccount/Service.php b/application/Espo/Core/Mail/Account/GroupAccount/Service.php index 1e84d3d214..83964f1a3f 100644 --- a/application/Espo/Core/Mail/Account/GroupAccount/Service.php +++ b/application/Espo/Core/Mail/Account/GroupAccount/Service.php @@ -103,11 +103,7 @@ class Service $imapParams = $account->getImapParams(); - if (!$imapParams) { - return null; - } - - return $imapParams->getPassword(); + return $imapParams?->getPassword(); } /** @@ -121,7 +117,7 @@ class Service $folder = $account->getSentFolder(); if (!$folder) { - throw new Error("No sent folder for Group Email Account {$id}."); + throw new Error("No sent folder for Group Email Account $id."); } $storage = $this->storageFactory->create($account); diff --git a/application/Espo/Core/Mail/Account/PersonalAccount/Service.php b/application/Espo/Core/Mail/Account/PersonalAccount/Service.php index 38bfe8918a..4494f66c80 100644 --- a/application/Espo/Core/Mail/Account/PersonalAccount/Service.php +++ b/application/Espo/Core/Mail/Account/PersonalAccount/Service.php @@ -29,16 +29,14 @@ namespace Espo\Core\Mail\Account\PersonalAccount; -use Espo\Core\Mail\Account\Account as Account; use Laminas\Mail\Message; +use Espo\Core\Mail\Account\Account as Account; use Espo\Core\Exceptions\Forbidden; use Espo\Core\Exceptions\Error; - use Espo\Core\Mail\Account\Fetcher; use Espo\Core\Mail\Account\Storage\Params; use Espo\Core\Mail\Account\StorageFactory; - use Espo\Entities\User; class Service @@ -141,11 +139,7 @@ class Service $imapParams = $account->getImapParams(); - if (!$imapParams) { - return null; - } - - return $imapParams->getPassword(); + return $imapParams?->getPassword(); } /** @@ -159,7 +153,7 @@ class Service $folder = $account->getSentFolder(); if (!$folder) { - throw new Error("No sent folder for Email Account {$id}."); + throw new Error("No sent folder for Email Account $id."); } $storage = $this->storageFactory->create($account);