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 ae6cb34 commit 7d76cac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/Spryker/Zed/Locale/Persistence/LocaleEntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ protected function executeUpdateStoreLocales(StoreTransfer $storeTransfer, array
$localeIds[] = $localeTransfer->getIdLocaleOrFail();
}

$this->getFactory()
/** @var \Propel\Runtime\Collection\ObjectCollection $localeStoreCollection */
$localeStoreCollection = $this->getFactory()
->createLocaleStorePropelQuery()
->filterByFkStore($idStore)
->filterByFkLocale($localeIds, Criteria::NOT_IN)
->find()
->delete();
->find();
$localeStoreCollection->delete();
}
}
14 changes: 9 additions & 5 deletions src/Spryker/Zed/Locale/Persistence/LocaleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Orm\Zed\Locale\Persistence\Map\SpyLocaleTableMap;
use Orm\Zed\Store\Persistence\Map\SpyStoreTableMap;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Collection\Collection;
use Spryker\Zed\Kernel\Persistence\AbstractRepository;

/**
Expand Down Expand Up @@ -171,9 +171,11 @@ public function getLocaleNamesGroupedByIdStore(array $storeIds): array
->filterByFkStore_In($storeIds)
->endUse();
$localeQuery->select([SpyLocaleTableMap::COL_LOCALE_NAME, SpyLocaleStoreTableMap::COL_FK_STORE]);
/** @var \Propel\Runtime\Collection\ObjectCollection $locales */
$locales = $localeQuery->find();

$localeCodesByStoreId = [];
foreach ($localeQuery->find()->toArray() as $localeData) {
foreach ($locales->toArray() as $localeData) {
/** @var int $fkStore */
$fkStore = $localeData[SpyLocaleStoreTableMap::COL_FK_STORE];
/** @var string $name */
Expand Down Expand Up @@ -204,10 +206,12 @@ public function getDefaultLocaleNamesIndexedByIdStore(array $storeIds): array
->useDefaultLocaleQuery()
->endUse();
$localeQuery->select([SpyLocaleTableMap::COL_LOCALE_NAME, SpyStoreTableMap::COL_ID_STORE]);
/** @var \Propel\Runtime\Collection\ObjectCollection $locales */
$locales = $localeQuery->find();

$localeNamesIndexedByIdStore = [];

foreach ($localeQuery->find()->toArray() as $localeData) {
foreach ($locales->toArray() as $localeData) {
/** @var int $idStore */
$idStore = $localeData[SpyStoreTableMap::COL_ID_STORE];
/** @var string $name */
Expand All @@ -220,11 +224,11 @@ public function getDefaultLocaleNamesIndexedByIdStore(array $storeIds): array
}

/**
* @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Locale\Persistence\SpyLocale> $localeEntities
* @param \Propel\Runtime\Collection\Collection<\Orm\Zed\Locale\Persistence\SpyLocale> $localeEntities
*
* @return array<\Generated\Shared\Transfer\LocaleTransfer>
*/
protected function mapLocaleEntitiesToLocaleTransfers(ObjectCollection $localeEntities): array
protected function mapLocaleEntitiesToLocaleTransfers(Collection $localeEntities): array
{
$localeTransfers = [];
$localeMapper = $this->getFactory()->createLocaleMapper();
Expand Down

0 comments on commit 7d76cac

Please sign in to comment.