diff --git a/application/Espo/Controllers/Admin.php b/application/Espo/Controllers/Admin.php index 34bd24187c..766ecc120e 100644 --- a/application/Espo/Controllers/Admin.php +++ b/application/Espo/Controllers/Admin.php @@ -168,6 +168,7 @@ class Admin /** * @return array + * @throws \Espo\Core\Exceptions\Error */ public function actionAdminNotificationList(): array { diff --git a/application/Espo/Core/Action/ActionFactory.php b/application/Espo/Core/Action/ActionFactory.php index 3cc1709319..f3ba251d1e 100644 --- a/application/Espo/Core/Action/ActionFactory.php +++ b/application/Espo/Core/Action/ActionFactory.php @@ -65,8 +65,10 @@ class ActionFactory /** * @param array $with - * @deprecated + * @throws NotFound + * @throws Forbidden * @todo Remove. + * @deprecated */ public function createWith(string $action, ?string $entityType, array $with): Action { diff --git a/application/Espo/Core/Api/Auth.php b/application/Espo/Core/Api/Auth.php index 4eccb9fb12..2b6289cff8 100644 --- a/application/Espo/Core/Api/Auth.php +++ b/application/Espo/Core/Api/Auth.php @@ -269,6 +269,7 @@ class Auth /** * @return array{?string,?string} + * @throws BadRequest */ protected function obtainUsernamePasswordFromRequest(Request $request): array { diff --git a/application/Espo/Core/ApplicationState.php b/application/Espo/Core/ApplicationState.php index 024cc97ad7..b79eabee77 100644 --- a/application/Espo/Core/ApplicationState.php +++ b/application/Espo/Core/ApplicationState.php @@ -55,6 +55,7 @@ class ApplicationState /** * Get a portal ID (if an application is portal). + * @throws Error */ public function getPortalId(): string { @@ -67,6 +68,7 @@ class ApplicationState /** * Get a portal entity (if an application is portal). + * @throws Error */ public function getPortal(): PortalEntity { @@ -88,6 +90,7 @@ class ApplicationState /** * Get a current logged user. If no auth is applied, then the system user will be returned. + * @throws Error */ public function getUser(): UserEntity { @@ -101,6 +104,7 @@ class ApplicationState /** * Get an ID of a current logged user. If no auth is applied, then the system user will be returned. + * @throws Error */ public function getUserId(): string { @@ -109,6 +113,7 @@ class ApplicationState /** * Whether a user is logged. + * @throws Error */ public function isLogged(): bool { @@ -125,6 +130,7 @@ class ApplicationState /** * Whether logged as an admin. + * @throws Error */ public function isAdmin(): bool { @@ -138,6 +144,7 @@ class ApplicationState /** * Whether logged as an API user. + * @throws Error */ public function isApi(): bool { diff --git a/application/Espo/Core/Controllers/Base.php b/application/Espo/Core/Controllers/Base.php index b57347277d..efc7494bbc 100644 --- a/application/Espo/Core/Controllers/Base.php +++ b/application/Espo/Core/Controllers/Base.php @@ -105,7 +105,8 @@ abstract class Base protected $serviceFactory; /** - * @internal Most of dependencies are for backward compatibility. + * @throws Forbidden + * @internal Most dependencies are for backward compatibility. */ public function __construct( Container $container, diff --git a/application/Espo/Core/Formula/Argument.php b/application/Espo/Core/Formula/Argument.php index eff94d28ae..586817fc04 100644 --- a/application/Espo/Core/Formula/Argument.php +++ b/application/Espo/Core/Formula/Argument.php @@ -67,6 +67,7 @@ class Argument implements Evaluatable /** * Get a nested argument list. + * @throws Error */ public function getArgumentList(): ArgumentList { diff --git a/application/Espo/Core/Formula/Functions/AttributeType.php b/application/Espo/Core/Formula/Functions/AttributeType.php index b20edda5a8..87e7af8687 100644 --- a/application/Espo/Core/Formula/Functions/AttributeType.php +++ b/application/Espo/Core/Formula/Functions/AttributeType.php @@ -49,6 +49,7 @@ class AttributeType extends Base /** * @return mixed + * @throws Error */ public function process(\stdClass $item) { @@ -62,6 +63,7 @@ class AttributeType extends Base /** * @param string $attribute * @return mixed + * @throws Error */ protected function getAttributeValue($attribute) { diff --git a/application/Espo/Core/Formula/Functions/Base.php b/application/Espo/Core/Formula/Functions/Base.php index 7655c3f1bb..ae2b21c03a 100644 --- a/application/Espo/Core/Formula/Functions/Base.php +++ b/application/Espo/Core/Formula/Functions/Base.php @@ -132,6 +132,7 @@ abstract class Base implements Injectable /** * @param mixed $item * @return mixed + * @throws \Espo\Core\Formula\Exceptions\Error */ protected function evaluate($item) { diff --git a/application/Espo/Core/Formula/Functions/BaseFunction.php b/application/Espo/Core/Formula/Functions/BaseFunction.php index 2b2ef0aa0c..bce3643492 100644 --- a/application/Espo/Core/Formula/Functions/BaseFunction.php +++ b/application/Espo/Core/Formula/Functions/BaseFunction.php @@ -98,6 +98,7 @@ abstract class BaseFunction * * @param Evaluatable $item Argument or ArgumentList. * @return mixed A result of evaluation. An array if an argument list was passed. + * @throws Error */ protected function evaluate(Evaluatable $item) { @@ -108,6 +109,7 @@ abstract class BaseFunction * Throws TooFewArguments exception. * * @return never + * @throws TooFewArguments */ protected function throwTooFewArguments(?int $number = null) { @@ -124,6 +126,7 @@ abstract class BaseFunction * Throw BadArgumentType exception. * * @return never + * @throws BadArgumentType */ protected function throwBadArgumentType(?int $index = null, ?string $type = null) { @@ -144,6 +147,7 @@ abstract class BaseFunction * Throw BadArgumentValue exception. * * @return never + * @throws BadArgumentValue */ protected function throwBadArgumentValue(?int $index = null, ?string $msg = null) { @@ -164,6 +168,7 @@ abstract class BaseFunction * Throw Error exception. * * @return never + * @throws Error */ protected function throwError(?string $msg = null) diff --git a/application/Espo/Core/Formula/Functions/ComparisonGroup/Base.php b/application/Espo/Core/Formula/Functions/ComparisonGroup/Base.php index a89684e82f..2e24df14bc 100644 --- a/application/Espo/Core/Formula/Functions/ComparisonGroup/Base.php +++ b/application/Espo/Core/Formula/Functions/ComparisonGroup/Base.php @@ -38,6 +38,7 @@ abstract class Base extends BaseFunction { /** * @return bool + * @throws \Espo\Core\Formula\Exceptions\TooFewArguments */ public function process(ArgumentList $args) { diff --git a/application/Espo/Core/Upgrades/Actions/Base.php b/application/Espo/Core/Upgrades/Actions/Base.php index 63e724a608..333fa72ede 100644 --- a/application/Espo/Core/Upgrades/Actions/Base.php +++ b/application/Espo/Core/Upgrades/Actions/Base.php @@ -311,6 +311,7 @@ abstract class Base /** * @return string + * @throws Error */ protected function getProcessId() { @@ -408,6 +409,7 @@ abstract class Base * @param string $currentVersion * @param string $errorMessage * @return bool + * @throws Error */ public function checkVersions($versionList, $currentVersion, $errorMessage = '') { @@ -448,6 +450,7 @@ abstract class Base /** * @return bool + * @throws Error */ protected function checkPackageType() { @@ -498,6 +501,7 @@ abstract class Base * Run a script by a type. * @param string $type Ex. "before", "after". * @return void + * @throws Error */ protected function runScript($type) { @@ -553,6 +557,7 @@ abstract class Base * @param string $name * @param bool $isPackage * @return string + * @throws Error */ protected function getPath($name = 'packagePath', $isPackage = false) { @@ -640,6 +645,7 @@ abstract class Base * @param string $type * @param bool $withEmptyDirs * @return bool + * @throws Error */ protected function deleteFiles($type = 'delete', $withEmptyDirs = false) { @@ -744,6 +750,7 @@ abstract class Base * @param string[] $fileList * @param bool $copyOnlyFiles * @return bool + * @throws Error */ protected function copy( $sourcePath, @@ -874,6 +881,7 @@ abstract class Base /** * @return array + * @throws Error */ public function getManifest() { @@ -952,6 +960,7 @@ abstract class Base * * @param ?string $packagePath * @return void + * @throws Error */ protected function unzipArchive($packagePath = null) { @@ -1026,6 +1035,7 @@ abstract class Base * @param string $actionName * @param string|array $data * @return void + * @throws Error */ protected function executeAction($actionName, $data) { @@ -1069,6 +1079,7 @@ abstract class Base /** * @return void + * @throws Error */ protected function clearCache() { @@ -1080,6 +1091,7 @@ abstract class Base /** * @return void + * @throws Error */ protected function checkIsWritable() { @@ -1101,6 +1113,7 @@ abstract class Base /** * @return bool + * @throws Error */ protected function backupExistingFiles() { @@ -1248,6 +1261,7 @@ abstract class Base /** * @param bool $isParentProcess * @return ?string + * @throws Error */ protected function getTemporaryConfigParamName($isParentProcess = false) { diff --git a/application/Espo/Core/Upgrades/Base.php b/application/Espo/Core/Upgrades/Base.php index 129ed58099..105d24e6e9 100644 --- a/application/Espo/Core/Upgrades/Base.php +++ b/application/Espo/Core/Upgrades/Base.php @@ -89,6 +89,7 @@ abstract class Base /** * @return array + * @throws Error */ public function getManifest() { @@ -98,6 +99,7 @@ abstract class Base /** * @param string $processId * @return array + * @throws Error */ public function getManifestById($processId) { @@ -110,6 +112,7 @@ abstract class Base /** * @param string $data * @return string + * @throws Error */ public function upload($data) { @@ -121,6 +124,7 @@ abstract class Base /** * @param array $data * @return mixed + * @throws Error */ public function install($data) { @@ -132,6 +136,7 @@ abstract class Base /** * @param array $data * @return mixed + * @throws Error */ public function uninstall($data) { @@ -143,6 +148,7 @@ abstract class Base /** * @param array $data * @return mixed + * @throws Error */ public function delete($data) { @@ -155,6 +161,7 @@ abstract class Base * @param string $stepName * @param array $params * @return bool + * @throws Error */ public function runInstallStep($stepName, array $params = []) { diff --git a/application/Espo/Core/Utils/Autoload.php b/application/Espo/Core/Utils/Autoload.php index f4554a9982..26d997315f 100644 --- a/application/Espo/Core/Utils/Autoload.php +++ b/application/Espo/Core/Utils/Autoload.php @@ -139,6 +139,7 @@ class Autoload /** * @return array + * @throws \JsonException */ private function loadDataFromFile(string $filePath): array { diff --git a/application/Espo/Modules/Crm/Controllers/Activities.php b/application/Espo/Modules/Crm/Controllers/Activities.php index 7b1366c8f0..78d4df0e82 100644 --- a/application/Espo/Modules/Crm/Controllers/Activities.php +++ b/application/Espo/Modules/Crm/Controllers/Activities.php @@ -201,6 +201,7 @@ class Activities /** * @return array> + * @throws \Exception */ public function getActionPopupNotifications(): array { diff --git a/application/Espo/Modules/Crm/Controllers/CaseObj.php b/application/Espo/Modules/Crm/Controllers/CaseObj.php index c372d89f82..9d31a43c1c 100644 --- a/application/Espo/Modules/Crm/Controllers/CaseObj.php +++ b/application/Espo/Modules/Crm/Controllers/CaseObj.php @@ -41,6 +41,8 @@ class CaseObj extends \Espo\Core\Controllers\Record /** * @return \stdClass[] + * @throws BadRequest + * @throws Forbidden */ public function getActionEmailAddressList(Request $request): array { diff --git a/application/Espo/Modules/Crm/Services/Activities.php b/application/Espo/Modules/Crm/Services/Activities.php index 1808782fe3..422546c69e 100644 --- a/application/Espo/Modules/Crm/Services/Activities.php +++ b/application/Espo/Modules/Crm/Services/Activities.php @@ -991,6 +991,7 @@ class Activities implements * } * @throws NotFound * @throws Error + * @throws Forbidden */ public function getHistory(string $scope, string $id, array $params = []): array { @@ -1713,6 +1714,7 @@ class Activities implements * @param ?array> $ignoreEventList * @return stdClass[] * @throws NotFound + * @throws Forbidden */ public function getBusyRangeList( string $userId, @@ -1900,6 +1902,7 @@ class Activities implements * @param ?string[] $scopeList * @return array> * @throws NotFound + * @throws Forbidden */ public function getEvents( string $userId, @@ -2020,6 +2023,7 @@ class Activities implements * list: stdClass[], * } * @throws Forbidden + * @throws NotFound */ public function getUpcomingActivities( string $userId, diff --git a/application/Espo/Modules/Crm/Services/CaseObj.php b/application/Espo/Modules/Crm/Services/CaseObj.php index 6a980592e6..d43608d540 100644 --- a/application/Espo/Modules/Crm/Services/CaseObj.php +++ b/application/Espo/Modules/Crm/Services/CaseObj.php @@ -88,6 +88,7 @@ class CaseObj extends Record /** * @return stdClass[] + * @throws \Espo\Core\Exceptions\ForbiddenSilent */ public function getEmailAddressList(string $id): array { diff --git a/application/Espo/ORM/BaseEntity.php b/application/Espo/ORM/BaseEntity.php index 9ffa67fb2b..745beeeef1 100644 --- a/application/Espo/ORM/BaseEntity.php +++ b/application/Espo/ORM/BaseEntity.php @@ -502,6 +502,7 @@ class BaseEntity implements Entity /** * @param mixed $value * @return mixed + * @throws \JsonException */ protected function prepareAttributeValue(string $attribute, $value) { @@ -566,6 +567,7 @@ class BaseEntity implements Entity /** * @param mixed $value + * @throws \JsonException */ private function prepareObjectAttributeValue($value): ?stdClass { diff --git a/application/Espo/Tools/EntityManager/Hooks/BasePlusType.php b/application/Espo/Tools/EntityManager/Hooks/BasePlusType.php index b4a25d8199..3d1d664c0a 100644 --- a/application/Espo/Tools/EntityManager/Hooks/BasePlusType.php +++ b/application/Espo/Tools/EntityManager/Hooks/BasePlusType.php @@ -38,6 +38,7 @@ class BasePlusType implements Di\ConfigAware, Di\MetadataAware /** * @param array $params + * @throws \Espo\Core\Exceptions\Error */ public function afterCreate(string $name, $params): void { @@ -105,4 +106,4 @@ class BasePlusType implements Di\ConfigAware, Di\MetadataAware $this->metadata->save(); } -} \ No newline at end of file +} diff --git a/application/Espo/Tools/FieldManager/Hooks/AutoincrementType.php b/application/Espo/Tools/FieldManager/Hooks/AutoincrementType.php index e37b2d2d17..de128e67ee 100644 --- a/application/Espo/Tools/FieldManager/Hooks/AutoincrementType.php +++ b/application/Espo/Tools/FieldManager/Hooks/AutoincrementType.php @@ -41,6 +41,7 @@ class AutoincrementType implements Di\MetadataAware /** * @param array $defs * @param array $options + * @throws Error */ public function beforeSave(string $scope, string $name, $defs, $options): void {