From ef82733c892b5dc5553463dc687bd05a7bcbd7bc Mon Sep 17 00:00:00 2001 From: Olha Livitchuk <77281282+olhalivitchuk@users.noreply.github.com> Date: Mon, 6 May 2024 14:15:28 +0200 Subject: [PATCH] FRW-7400 Upgraded PHPStan to `1.10.*`. (#10911) FRW-7400 Update PHPStan to 1.10.* --- .../Business/OrderStateMachine/OrderStateMachine.php | 1 + .../Zed/Oms/Business/OrderStateMachine/Timeout.php | 8 ++++---- .../Zed/Oms/Business/Reservation/ExportReservation.php | 3 ++- src/Spryker/Zed/Oms/Business/Util/OrderItemMatrix.php | 2 +- src/Spryker/Zed/Oms/Business/Util/TransitionLog.php | 2 +- .../Oms/Communication/Controller/TriggerController.php | 3 ++- .../Oms/Persistence/Propel/Mapper/OrderItemMapper.php | 10 +++++----- .../Propel/Mapper/OrderItemMapperInterface.php | 10 +++++----- 8 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/Spryker/Zed/Oms/Business/OrderStateMachine/OrderStateMachine.php b/src/Spryker/Zed/Oms/Business/OrderStateMachine/OrderStateMachine.php index 4047f50b..9b49e8e2 100644 --- a/src/Spryker/Zed/Oms/Business/OrderStateMachine/OrderStateMachine.php +++ b/src/Spryker/Zed/Oms/Business/OrderStateMachine/OrderStateMachine.php @@ -867,6 +867,7 @@ protected function getOrderItemsByState( } $omsProcessEntity = $this->queryContainer->queryProcess($process->getName())->findOne(); + /** @var \Propel\Runtime\Collection\ObjectCollection $omsOrderItemEntityCollection */ $omsOrderItemEntityCollection = $this->queryContainer->querySalesOrderItemStatesByName($states)->find(); if ($omsProcessEntity === null || $omsOrderItemEntityCollection->count() === 0) { diff --git a/src/Spryker/Zed/Oms/Business/OrderStateMachine/Timeout.php b/src/Spryker/Zed/Oms/Business/OrderStateMachine/Timeout.php index 0cd725d3..4f260d33 100644 --- a/src/Spryker/Zed/Oms/Business/OrderStateMachine/Timeout.php +++ b/src/Spryker/Zed/Oms/Business/OrderStateMachine/Timeout.php @@ -17,7 +17,7 @@ use Orm\Zed\Oms\Persistence\SpyOmsEventTimeout; use Orm\Zed\Oms\Persistence\SpyOmsEventTimeoutQuery; use Orm\Zed\Sales\Persistence\SpySalesOrderItem; -use Propel\Runtime\Collection\ObjectCollection; +use Propel\Runtime\Collection\Collection; use RuntimeException; use Spryker\Zed\Oms\Business\Process\EventInterface; use Spryker\Zed\Oms\Business\Process\ProcessInterface; @@ -239,11 +239,11 @@ protected function getStateFromProcess($stateId, ProcessInterface $process) } /** - * @param \Propel\Runtime\Collection\ObjectCollection $orderItems + * @param \Propel\Runtime\Collection\Collection $orderItems * * @return array */ - protected function groupItemsByEvent(ObjectCollection $orderItems) + protected function groupItemsByEvent(Collection $orderItems) { $groupedOrderItems = []; foreach ($orderItems as $orderItem) { @@ -263,7 +263,7 @@ protected function groupItemsByEvent(ObjectCollection $orderItems) /** * @param \Generated\Shared\Transfer\OmsCheckTimeoutsQueryCriteriaTransfer|null $omsCheckTimeoutsQueryCriteriaTransfer * - * @return \Propel\Runtime\Collection\ObjectCollection + * @return \Propel\Runtime\Collection\Collection */ protected function findItemsWithExpiredTimeouts(?OmsCheckTimeoutsQueryCriteriaTransfer $omsCheckTimeoutsQueryCriteriaTransfer = null) { diff --git a/src/Spryker/Zed/Oms/Business/Reservation/ExportReservation.php b/src/Spryker/Zed/Oms/Business/Reservation/ExportReservation.php index c41e1c08..062a4f26 100644 --- a/src/Spryker/Zed/Oms/Business/Reservation/ExportReservation.php +++ b/src/Spryker/Zed/Oms/Business/Reservation/ExportReservation.php @@ -62,6 +62,7 @@ public function exportReservation() $lastExportedVersion = $this->getLastExportedVersion(); $currentStoreTransfer = $this->storeFacade->getCurrentStore(); + /** @var \Propel\Runtime\Collection\ObjectCollection $reservations */ $reservations = $this->findReservations($lastExportedVersion, $maxVersion); if (count($reservations) === 0) { @@ -166,7 +167,7 @@ protected function exportReservations(array $reservations, StoreTransfer $curren * @param int $lastExportedVersion * @param int $maxVisibleVersion * - * @return \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Oms\Persistence\SpyOmsProductReservationChangeVersion> + * @return \Propel\Runtime\Collection\Collection<\Orm\Zed\Oms\Persistence\SpyOmsProductReservationChangeVersion> */ protected function findReservations($lastExportedVersion, $maxVisibleVersion) { diff --git a/src/Spryker/Zed/Oms/Business/Util/OrderItemMatrix.php b/src/Spryker/Zed/Oms/Business/Util/OrderItemMatrix.php index 97b586ba..14c1548f 100644 --- a/src/Spryker/Zed/Oms/Business/Util/OrderItemMatrix.php +++ b/src/Spryker/Zed/Oms/Business/Util/OrderItemMatrix.php @@ -143,7 +143,7 @@ protected function formatElement(array $gridInput, int $idProcess, int $idState) } /** - * @return \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Oms\Persistence\SpyOmsOrderProcess> + * @return \Propel\Runtime\Collection\Collection<\Orm\Zed\Oms\Persistence\SpyOmsOrderProcess> */ protected function getActiveProcesses() { diff --git a/src/Spryker/Zed/Oms/Business/Util/TransitionLog.php b/src/Spryker/Zed/Oms/Business/Util/TransitionLog.php index 6cbfaa63..c737a621 100644 --- a/src/Spryker/Zed/Oms/Business/Util/TransitionLog.php +++ b/src/Spryker/Zed/Oms/Business/Util/TransitionLog.php @@ -299,7 +299,7 @@ protected function getEntity() /** * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $order * - * @return \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Oms\Persistence\SpyOmsTransitionLog> + * @return \Propel\Runtime\Collection\Collection<\Orm\Zed\Oms\Persistence\SpyOmsTransitionLog> */ public function getLogForOrder(SpySalesOrder $order) { diff --git a/src/Spryker/Zed/Oms/Communication/Controller/TriggerController.php b/src/Spryker/Zed/Oms/Communication/Controller/TriggerController.php index 90c38618..c4706184 100644 --- a/src/Spryker/Zed/Oms/Communication/Controller/TriggerController.php +++ b/src/Spryker/Zed/Oms/Communication/Controller/TriggerController.php @@ -116,6 +116,7 @@ public function submitTriggerEventForOrderAction(Request $request) /** @var string $redirect */ $redirect = $request->query->get(static::REQUEST_PARAMETER_REDIRECT, '/'); + /** @var \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Sales\Persistence\SpySalesOrderItem> $orderItems */ $orderItems = $this->getOrderItemsToTriggerAction($idOrder, $request->query->all(static::REQUEST_PARAMETER_ITEMS) ?: null); $triggerEventReturnData = $this->getFacade()->triggerEvent($event, $orderItems, []); @@ -151,7 +152,7 @@ protected function addOmsEventTriggerStatusMessage(?array $triggerEventReturnDat * @param int $idOrder * @param array|null $itemsList * - * @return \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Sales\Persistence\SpySalesOrderItem> + * @return \Propel\Runtime\Collection\Collection<\Orm\Zed\Sales\Persistence\SpySalesOrderItem> */ protected function getOrderItemsToTriggerAction($idOrder, $itemsList = null) { diff --git a/src/Spryker/Zed/Oms/Persistence/Propel/Mapper/OrderItemMapper.php b/src/Spryker/Zed/Oms/Persistence/Propel/Mapper/OrderItemMapper.php index a9d9d8c7..db1ddd48 100644 --- a/src/Spryker/Zed/Oms/Persistence/Propel/Mapper/OrderItemMapper.php +++ b/src/Spryker/Zed/Oms/Persistence/Propel/Mapper/OrderItemMapper.php @@ -10,7 +10,7 @@ use Generated\Shared\Transfer\ItemStateTransfer; use Generated\Shared\Transfer\ItemTransfer; use Orm\Zed\Sales\Persistence\Map\SpySalesOrderItemTableMap; -use Propel\Runtime\Collection\ObjectCollection; +use Propel\Runtime\Collection\Collection; use Spryker\Zed\Oms\Persistence\OmsQueryContainer; class OrderItemMapper implements OrderItemMapperInterface @@ -36,12 +36,12 @@ public function mapOrderItemMatrix(array $orderItemsMatrixResult): array } /** - * @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Oms\Persistence\SpyOmsOrderItemStateHistory> $omsOrderItemStateHistoryEntities + * @param \Propel\Runtime\Collection\Collection<\Orm\Zed\Oms\Persistence\SpyOmsOrderItemStateHistory> $omsOrderItemStateHistoryEntities * * @return array<\Generated\Shared\Transfer\ItemStateTransfer> */ public function mapOmsOrderItemStateHistoryEntityCollectionToItemStateHistoryTransfers( - ObjectCollection $omsOrderItemStateHistoryEntities + Collection $omsOrderItemStateHistoryEntities ): array { $itemStateTransfers = []; @@ -57,12 +57,12 @@ public function mapOmsOrderItemStateHistoryEntityCollectionToItemStateHistoryTra } /** - * @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Sales\Persistence\SpySalesOrderItem> $salesOrderItemEntityCollection + * @param \Propel\Runtime\Collection\Collection<\Orm\Zed\Sales\Persistence\SpySalesOrderItem> $salesOrderItemEntityCollection * * @return array<\Generated\Shared\Transfer\ItemTransfer> */ public function mapSalesOrderItemEntityCollectionToOrderItemTransfers( - ObjectCollection $salesOrderItemEntityCollection + Collection $salesOrderItemEntityCollection ): array { $itemTransfers = []; diff --git a/src/Spryker/Zed/Oms/Persistence/Propel/Mapper/OrderItemMapperInterface.php b/src/Spryker/Zed/Oms/Persistence/Propel/Mapper/OrderItemMapperInterface.php index d970998a..5f394c2d 100644 --- a/src/Spryker/Zed/Oms/Persistence/Propel/Mapper/OrderItemMapperInterface.php +++ b/src/Spryker/Zed/Oms/Persistence/Propel/Mapper/OrderItemMapperInterface.php @@ -7,7 +7,7 @@ namespace Spryker\Zed\Oms\Persistence\Propel\Mapper; -use Propel\Runtime\Collection\ObjectCollection; +use Propel\Runtime\Collection\Collection; interface OrderItemMapperInterface { @@ -19,20 +19,20 @@ interface OrderItemMapperInterface public function mapOrderItemMatrix(array $orderItemsMatrixResult): array; /** - * @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Oms\Persistence\SpyOmsOrderItemStateHistory> $omsOrderItemStateHistoryEntities + * @param \Propel\Runtime\Collection\Collection<\Orm\Zed\Oms\Persistence\SpyOmsOrderItemStateHistory> $omsOrderItemStateHistoryEntities * * @return array<\Generated\Shared\Transfer\ItemStateTransfer> */ public function mapOmsOrderItemStateHistoryEntityCollectionToItemStateHistoryTransfers( - ObjectCollection $omsOrderItemStateHistoryEntities + Collection $omsOrderItemStateHistoryEntities ): array; /** - * @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Sales\Persistence\SpySalesOrderItem> $salesOrderItemEntityCollection + * @param \Propel\Runtime\Collection\Collection<\Orm\Zed\Sales\Persistence\SpySalesOrderItem> $salesOrderItemEntityCollection * * @return array<\Generated\Shared\Transfer\ItemTransfer> */ public function mapSalesOrderItemEntityCollectionToOrderItemTransfers( - ObjectCollection $salesOrderItemEntityCollection + Collection $salesOrderItemEntityCollection ): array; }