Skip to content

Commit

Permalink
fix: phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
fox-john committed Oct 25, 2024
1 parent e194b2e commit 63a6bc8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/Repository/AbstractRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,16 @@ protected function getShopContext()
}

/**
* @param string $tableName
*
* @return array<mixed>|bool|\mysqli_result|\PDOStatement|resource|null
*
* @throws \PrestaShopException
* @throws \PrestaShopDatabaseException
*/
protected function checkIfTableExist($query)
protected function checkIfTableExist($tableName)
{
$request = 'SELECT * FROM information_schema.tables WHERE table_name LIKE \'' . $query . '\' LIMIT 1;';
$request = 'SELECT * FROM information_schema.tables WHERE table_name LIKE \'' . $tableName . '\' LIMIT 1;';

return $this->db->executeS($request);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Repository/IncrementalSyncRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ public function getIncrementalSyncObjects($shopContent, $langIso, $limit)
->limit($limit)
;

$this->query->select(
'eis.type',
'eis.id_object as id',
'eis.action'
);
$this->query
->select('eis.type')
->select('eis.id_object as id')
->select('eis.action')
;

return $this->runQuery(true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/TranslationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function countFullSyncContentLeft($offset, $limit, $langIso)
{
// this table doesn't exist in the database before 1.7
if (empty(parent::checkIfTableExist('%translation'))) {
return [];
return 0;
}

$this->generateFullQuery($langIso, false);
Expand Down
9 changes: 9 additions & 0 deletions src/Service/ShopContent/ShopContentAbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@

abstract class ShopContentAbstractService
{
/**
* @param string $collection
* @param string $idKeyForBinding
* @param array<mixed> $upsertedContents
* @param array<mixed> $upsertedList
* @param array<mixed> $deletedList
*
* @return array<mixed>
*/
protected function formatIncrementalSyncResponse($collection, $idKeyForBinding, $upsertedContents, $upsertedList, $deletedList)
{
$data = [];
Expand Down

0 comments on commit 63a6bc8

Please sign in to comment.