diff --git a/application/Espo/Tools/Kanban/Kanban.php b/application/Espo/Tools/Kanban/Kanban.php index 8aa9a17afd..ba6fc44dc3 100644 --- a/application/Espo/Tools/Kanban/Kanban.php +++ b/application/Espo/Tools/Kanban/Kanban.php @@ -49,20 +49,17 @@ class Kanban private const MAX_GROUP_LENGTH = 100; - protected $entityType; + protected ?string $entityType = null; - protected $countDisabled = false; + protected bool $countDisabled = false; - protected $orderDisabled = false; + protected bool $orderDisabled = false; - /** - * @var ?SearchParams - */ - protected $searchParams = null; + protected ?SearchParams $searchParams = null; - protected $userId = null; + protected ?string $userId = null; - protected $maxOrderNumber = self::DEFAULT_MAX_ORDER_NUMBER; + protected int $maxOrderNumber = self::DEFAULT_MAX_ORDER_NUMBER; private $metadata; @@ -301,6 +298,10 @@ class Kanban return $statusField; } + /** + * @return string[] + * @throws Error + */ protected function getStatusList(): array { $statusField = $this->getStatusField(); @@ -314,6 +315,9 @@ class Kanban return $statusList; } + /** + * @return string[] + */ protected function getStatusIgnoreList(): array { return $this->metadata->get(['scopes', $this->entityType, 'kanbanStatusIgnoreList'], []); diff --git a/application/Espo/Tools/Kanban/KanbanService.php b/application/Espo/Tools/Kanban/KanbanService.php index 90ce20ec55..2a30f08a2c 100644 --- a/application/Espo/Tools/Kanban/KanbanService.php +++ b/application/Espo/Tools/Kanban/KanbanService.php @@ -93,6 +93,10 @@ class KanbanService ->getResult(); } + /** + * @param string[] $ids + * @throws ForbiddenSilent + */ public function order(string $entityType, string $group, array $ids): void { $this->processAccessCheck($entityType); @@ -116,7 +120,7 @@ class KanbanService return $this->injectableFactory->create(Kanban::class); } - private function processAccessCheck($entityType): void + private function processAccessCheck(string $entityType): void { if (!$this->metadata->get(['scopes', $entityType, 'object'])) { throw new ForbiddenSilent("Non-object entities are not supported."); diff --git a/application/Espo/Tools/Kanban/OrdererProcessor.php b/application/Espo/Tools/Kanban/OrdererProcessor.php index e17cb6883e..1cbc1e3e9a 100644 --- a/application/Espo/Tools/Kanban/OrdererProcessor.php +++ b/application/Espo/Tools/Kanban/OrdererProcessor.php @@ -43,17 +43,17 @@ class OrdererProcessor private const DEFAULT_MAX_NUMBER = 50; - private $entityType; + private ?string $entityType = null; - private $group; + private ?string $group = null; - private $userId = null; + private ?string $userId = null; - private $maxNumber = self::DEFAULT_MAX_NUMBER; + private int $maxNumber = self::DEFAULT_MAX_NUMBER; - private $entityManager; + private EntityManager $entityManager; - private $metadata; + private Metadata $metadata; public function __construct(EntityManager $entityManager, Metadata $metadata) { @@ -95,6 +95,9 @@ class OrdererProcessor return $this; } + /** + * @param string[] $ids + */ public function order(array $ids): void { $this->validate(); diff --git a/application/Espo/Tools/Kanban/Result.php b/application/Espo/Tools/Kanban/Result.php index fa5867e21b..6631804a40 100644 --- a/application/Espo/Tools/Kanban/Result.php +++ b/application/Espo/Tools/Kanban/Result.php @@ -29,27 +29,34 @@ namespace Espo\Tools\Kanban; -use Espo\{ - ORM\EntityCollection, -}; +use Espo\ORM\EntityCollection; -use StdClass; +use stdClass; class Result { - private $collection; + /** + * @var EntityCollection<\Espo\ORM\Entity> + */ + private EntityCollection $collection; - private $total; + private int $total; - private $data; + private stdClass $data; - public function __construct(EntityCollection $collection, int $total, StdClass $data) + /** + * @param EntityCollection<\Espo\ORM\Entity> $collection + */ + public function __construct(EntityCollection $collection, int $total, stdClass $data) { $this->collection = $collection; $this->total = $total; $this->data = $data; } + /** + * @return EntityCollection<\Espo\ORM\Entity> + */ public function getCollection(): EntityCollection { return $this->collection; @@ -60,7 +67,7 @@ class Result return $this->total; } - public function getData(): StdClass + public function getData(): stdClass { return $this->data; }