Skip to content

Commit

Permalink
FRW-7400 Upgraded PHPStan to 1.10.*. (#10911)
Browse files Browse the repository at this point in the history
FRW-7400 Update PHPStan to 1.10.*
  • Loading branch information
olhalivitchuk authored May 6, 2024
1 parent da827d2 commit ef82733
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions src/Spryker/Zed/Oms/Business/OrderStateMachine/Timeout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Spryker/Zed/Oms/Business/Util/OrderItemMatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Spryker/Zed/Oms/Business/Util/TransitionLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, []);
Expand Down Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = [];

Expand All @@ -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 = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Spryker\Zed\Oms\Persistence\Propel\Mapper;

use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Collection\Collection;

interface OrderItemMapperInterface
{
Expand All @@ -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;
}

0 comments on commit ef82733

Please sign in to comment.