diff --git a/application/Espo/Controllers/Admin.php b/application/Espo/Controllers/Admin.php index 5a2b659bbe..34bd24187c 100644 --- a/application/Espo/Controllers/Admin.php +++ b/application/Espo/Controllers/Admin.php @@ -106,14 +106,15 @@ class Admin /** - * @todo Use Request. - * * @param array $params * @param string $data * @return array{ * id: string, * version: string, * } + * @throws Forbidden + * @todo Use Request. + * */ public function postActionUploadUpgradePackage($params, $data): array { @@ -134,6 +135,9 @@ class Admin ]; } + /** + * @throws Forbidden + */ public function postActionRunUpgrade(Request $request): bool { $data = $request->getParsedBody(); diff --git a/application/Espo/Core/Api/ActionProcessor.php b/application/Espo/Core/Api/ActionProcessor.php index 391b0d6d60..21f00defa8 100644 --- a/application/Espo/Core/Api/ActionProcessor.php +++ b/application/Espo/Core/Api/ActionProcessor.php @@ -135,6 +135,7 @@ class ActionProcessor /** * @param mixed $result + * @throws \JsonException */ private function handleResult(Response $response, $result): void { diff --git a/application/Espo/Core/Application.php b/application/Espo/Core/Application.php index b5e4f41f51..1c2c146d60 100644 --- a/application/Espo/Core/Application.php +++ b/application/Espo/Core/Application.php @@ -160,6 +160,7 @@ class Application /** * Setup the system user. The system user is used when no user is logged in. + * @throws Exceptions\Error */ public function setupSystemUser(): void { diff --git a/application/Espo/Core/ApplicationUser.php b/application/Espo/Core/ApplicationUser.php index cb1d58aee6..e7b166bd71 100644 --- a/application/Espo/Core/ApplicationUser.php +++ b/application/Espo/Core/ApplicationUser.php @@ -58,6 +58,7 @@ class ApplicationUser /** * Setup the system user as a current user. The system user is used when no user is logged in. + * @throws Error */ public function setupSystemUser(): void { diff --git a/application/Espo/Core/Formula/Functions/EntityGroup/AddLinkMultipleIdType.php b/application/Espo/Core/Formula/Functions/EntityGroup/AddLinkMultipleIdType.php index a2817edb5f..15ef60ab92 100644 --- a/application/Espo/Core/Formula/Functions/EntityGroup/AddLinkMultipleIdType.php +++ b/application/Espo/Core/Formula/Functions/EntityGroup/AddLinkMultipleIdType.php @@ -35,6 +35,7 @@ class AddLinkMultipleIdType extends \Espo\Core\Formula\Functions\Base { /** * @return void + * @throws Error */ public function process(\stdClass $item) { diff --git a/application/Espo/Core/Upgrades/ActionManager.php b/application/Espo/Core/Upgrades/ActionManager.php index 53493fade7..8afc41733e 100644 --- a/application/Espo/Core/Upgrades/ActionManager.php +++ b/application/Espo/Core/Upgrades/ActionManager.php @@ -118,6 +118,7 @@ class ActionManager /** * @param mixed $data * @return mixed + * @throws Error */ public function run($data) { @@ -129,6 +130,7 @@ class ActionManager /** * @param string $actionName * @return \Espo\Core\Upgrades\Actions\Base + * @throws Error */ public function getActionClass($actionName) { @@ -137,6 +139,7 @@ class ActionManager /** * @return array + * @throws Error */ public function getManifest() { @@ -146,6 +149,7 @@ class ActionManager /** * @param ?string $actionName * @return \Espo\Core\Upgrades\Actions\Base + * @throws Error */ protected function getObject($actionName = null) { diff --git a/application/Espo/Core/Utils/AdminNotificationManager.php b/application/Espo/Core/Utils/AdminNotificationManager.php index 56c91d8f7d..174010245a 100644 --- a/application/Espo/Core/Utils/AdminNotificationManager.php +++ b/application/Espo/Core/Utils/AdminNotificationManager.php @@ -64,6 +64,7 @@ class AdminNotificationManager /** * @return array + * @throws \Espo\Core\Exceptions\Error */ public function getNotificationList(): array { diff --git a/application/Espo/Core/Utils/Client/ActionRenderer.php b/application/Espo/Core/Utils/Client/ActionRenderer.php index 27a2aa3cf7..dccd189656 100644 --- a/application/Espo/Core/Utils/Client/ActionRenderer.php +++ b/application/Espo/Core/Utils/Client/ActionRenderer.php @@ -46,6 +46,8 @@ class ActionRenderer /** * @param ?array $data + * @throws \JsonException + * @throws \JsonException */ public function render(string $controller, string $action, ?array $data = null): string { diff --git a/application/Espo/Modules/Crm/Controllers/Activities.php b/application/Espo/Modules/Crm/Controllers/Activities.php index 81771202be..7b1366c8f0 100644 --- a/application/Espo/Modules/Crm/Controllers/Activities.php +++ b/application/Espo/Modules/Crm/Controllers/Activities.php @@ -30,8 +30,10 @@ namespace Espo\Modules\Crm\Controllers; use Espo\Core\Exceptions\{ + Error, Forbidden, BadRequest, + NotFound, }; use Espo\Core\{ @@ -71,6 +73,9 @@ class Activities /** * @return array> + * @throws Forbidden + * @throws BadRequest + * @throws \Exception */ public function getActionListCalendarEvents(Request $request): array { @@ -119,6 +124,10 @@ class Activities return $this->service->getEventList($userId, $from, $to, $scopeList); } + /** + * @throws BadRequest + * @throws Forbidden + */ public function getActionGetTimeline(Request $request): stdClass { if (!$this->acl->check('Calendar')) { @@ -159,6 +168,9 @@ class Activities return $this->service->getUsersTimeline($userIdList, $from, $to, $scopeList); } + /** + * @throws Forbidden + */ public function getActionListUpcoming(Request $request): stdClass { $userId = $request->getQueryParam('userId'); @@ -197,6 +209,9 @@ class Activities return $this->service->getPopupNotifications($userId); } + /** + * @throws BadRequest + */ public function postActionRemovePopupNotification(Request $request): bool { $data = $request->getParsedBody(); @@ -212,6 +227,12 @@ class Activities return true; } + /** + * @throws BadRequest + * @throws Error + * @throws Forbidden + * @throws NotFound + */ public function getActionList(Request $request): stdClass { $params = $request->getRouteParams(); diff --git a/application/Espo/Modules/Crm/Services/Activities.php b/application/Espo/Modules/Crm/Services/Activities.php index 064d928bcd..1808782fe3 100644 --- a/application/Espo/Modules/Crm/Services/Activities.php +++ b/application/Espo/Modules/Crm/Services/Activities.php @@ -931,6 +931,7 @@ class Activities implements * } * @throws NotFound * @throws Error + * @throws Forbidden */ public function getActivities(string $scope, string $id, array $params = []): array { @@ -1582,6 +1583,7 @@ class Activities implements * @param string[] $userIdList * @param ?string[] $scopeList * @return array[] + * @throws Exception */ public function getEventsForUsers(array $userIdList, string $from, string $to, ?array $scopeList = null): array { @@ -1624,6 +1626,7 @@ class Activities implements * @param string[] $teamIdList * @param ?string[] $scopeList * @return array> + * @throws Forbidden */ public function getEventsForTeams(array $teamIdList, string $from, string $to, ?array $scopeList = null): array { @@ -1634,6 +1637,7 @@ class Activities implements * @param string[] $teamIdList * @param ?string[] $scopeList * @return array> + * @throws Forbidden */ public function getTeamsEventList(array $teamIdList, string $from, string $to, ?array $scopeList = null): array { @@ -1708,6 +1712,7 @@ class Activities implements * @param ?string[] $scopeList * @param ?array> $ignoreEventList * @return stdClass[] + * @throws NotFound */ public function getBusyRangeList( string $userId, @@ -1825,6 +1830,7 @@ class Activities implements * @param ?string[] $scopeList * @return array> * @throws NotFound + * @throws Forbidden */ public function getEventList( string $userId, @@ -1929,6 +1935,7 @@ class Activities implements /** * @return array> + * @throws Exception */ public function getPopupNotifications(string $userId): array { @@ -2012,6 +2019,7 @@ class Activities implements * total: int, * list: stdClass[], * } + * @throws Forbidden */ public function getUpcomingActivities( string $userId, diff --git a/application/Espo/Services/AdminNotifications.php b/application/Espo/Services/AdminNotifications.php index 66778f9f9f..99465f4e9d 100644 --- a/application/Espo/Services/AdminNotifications.php +++ b/application/Espo/Services/AdminNotifications.php @@ -53,6 +53,7 @@ class AdminNotifications implements /** * Job for checking a new version of EspoCRM. + * @throws \Espo\Core\Exceptions\Error */ public function jobCheckNewVersion(): void { @@ -96,6 +97,7 @@ class AdminNotifications implements /** * Job for checking a new version of installed extensions. + * @throws \Espo\Core\Exceptions\Error */ public function jobCheckNewExtensionVersion(): void { diff --git a/application/Espo/Services/App.php b/application/Espo/Services/App.php index c3a4047b01..751945370b 100644 --- a/application/Espo/Services/App.php +++ b/application/Espo/Services/App.php @@ -425,6 +425,7 @@ class App } /** + * @throws \Espo\Core\Exceptions\Error * @todo Remove in 7.2. Move to another place. CLI command. */ public function jobPopulateArrayValues(): void