diff --git a/application/Espo/ORM/Collection.php b/application/Espo/ORM/Collection.php index afc7f8961a..85da05a5a2 100644 --- a/application/Espo/ORM/Collection.php +++ b/application/Espo/ORM/Collection.php @@ -34,6 +34,8 @@ use Traversable; /** * A collection of entities. * + * @template T + * * @todo Extend from Traversable once the min supported PHP version is 7.4. */ interface Collection/* extends Traversable*/ diff --git a/application/Espo/Services/User.php b/application/Espo/Services/User.php index fb9bc1e989..2d95c10e6a 100644 --- a/application/Espo/Services/User.php +++ b/application/Espo/Services/User.php @@ -29,6 +29,8 @@ namespace Espo\Services; +use Espo\Entities\User as UserEntity; + use Espo\Core\{ Exceptions\Forbidden, Exceptions\Error, @@ -78,6 +80,7 @@ class User extends Record implements throw new Forbidden(); } + /** @var UserEntity $entity */ $entity = parent::getEntity($id); if ($entity && $entity->isSuperAdmin() && !$this->getUser()->isSuperAdmin()) { diff --git a/application/Espo/Tools/Import/Service.php b/application/Espo/Tools/Import/Service.php index 0b449e0eff..7c76e2521d 100644 --- a/application/Espo/Tools/Import/Service.php +++ b/application/Espo/Tools/Import/Service.php @@ -246,7 +246,7 @@ class Service } /** - * @return Attachment ID. + * @return string Attachment ID. */ public function uploadFile(string $contents): string { diff --git a/application/Espo/Tools/Notification/NoteHookProcessor.php b/application/Espo/Tools/Notification/NoteHookProcessor.php index a9bf3092b3..6fa7c14bb3 100644 --- a/application/Espo/Tools/Notification/NoteHookProcessor.php +++ b/application/Espo/Tools/Notification/NoteHookProcessor.php @@ -401,7 +401,7 @@ class NoteHookProcessor } /** - * @return User[] + * @return Collection */ private function getSubscriberList(string $parentType, string $parentId, bool $isInternal = false): Collection { diff --git a/application/Espo/Tools/Stream/HookProcessor.php b/application/Espo/Tools/Stream/HookProcessor.php index 05dee93cd9..1f2802aef4 100644 --- a/application/Espo/Tools/Stream/HookProcessor.php +++ b/application/Espo/Tools/Stream/HookProcessor.php @@ -46,6 +46,8 @@ use Espo\Core\Utils\DateTime as DateTimeUtil; use Espo\Tools\Stream\Jobs\AutoFollow as AutoFollowJob; use Espo\Tools\Stream\Jobs\ControlFollowers as ControlFollowersJob; +use Espo\Core\ORM\Entity as CoreEntity; + /** * Handles operations with entities. */ @@ -331,6 +333,9 @@ class HookProcessor $this->afterSaveStreamNotNew($entity, $options); } + /** + * @param CoreEntity $entity + */ private function afterSaveStreamNew(Entity $entity, array $options): void { $entityType = $entity->getEntityType(); @@ -401,6 +406,9 @@ class HookProcessor $this->afterSaveStreamNotNew2($entity); } + /** + * @param CoreEntity $entity + */ private function afterSaveStreamNotNew1(Entity $entity, array $options): void { if (!empty($options['noStream']) || !empty($options['silent'])) { @@ -514,6 +522,9 @@ class HookProcessor return $this->statusFields; } + /** + * @param CoreEntity $entity + */ public function afterRelate(Entity $entity, Entity $foreignEntity, string $link, array $options): void { $entityType = $entity->getEntityType(); @@ -540,6 +551,9 @@ class HookProcessor } } + /** + * @param CoreEntity $entity + */ public function afterUnrelate(Entity $entity, Entity $foreignEntity, string $link, array $options): void { $entityType = $entity->getEntityType();