Skip to content

Commit

Permalink
[TASK] Apply code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbltr committed Oct 25, 2024
1 parent 1da9a31 commit 7ee474b
Show file tree
Hide file tree
Showing 24 changed files with 116 additions and 140 deletions.
3 changes: 1 addition & 2 deletions Classes/Backend/Filterlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ public function getListOfAvailableFilteroptionsForFlexforms(&$config)
}

if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilteroptionsForFlexforms'] ?? null)) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilteroptionsForFlexforms'] as
$_classRef) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilteroptionsForFlexforms'] as $_classRef) {
$_procObj = GeneralUtility::makeInstance($_classRef);
$_procObj->modifyFilteroptionsForFlexforms($config, $rowFilter, $this);
}
Expand Down
5 changes: 2 additions & 3 deletions Classes/Domain/Repository/BaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Tpwd\KeSearch\Domain\Repository;

use PDO;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
Expand Down Expand Up @@ -84,7 +83,7 @@ public function findByUid($uid, bool $includeHiddenAndTimeRestricted = false)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand All @@ -111,7 +110,7 @@ public function findAllDeletedAndHiddenByPidListAndTimestampInAllLanguages(array
)
->andWhere(
$queryBuilder->expr()->in('pid', $queryBuilder->createNamedParameter($pidList, Connection::PARAM_INT_ARRAY)),
$queryBuilder->expr()->gte('tstamp', $queryBuilder->createNamedParameter($tstamp, PDO::PARAM_INT))
$queryBuilder->expr()->gte('tstamp', $queryBuilder->createNamedParameter($tstamp, \PDO::PARAM_INT))
)
->executeQuery()
->fetchAllAssociative();
Expand Down
5 changes: 2 additions & 3 deletions Classes/Domain/Repository/CategoryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tpwd\KeSearch\Domain\Repository;

use PDO;
use Tpwd\KeSearch\Lib\SearchHelper;

/***************************************************************
Expand Down Expand Up @@ -47,7 +46,7 @@ public function findAllSubcategoriesByParentUid($categoryUid, bool $includeHidde
->where(
$queryBuilder->expr()->eq(
'parent',
$queryBuilder->createNamedParameter($categoryUid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($categoryUid, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down Expand Up @@ -92,7 +91,7 @@ public function findAssignedToRecord(string $tableName, int $uid, bool $includeH
),
$queryBuilder->expr()->eq(
$tableName . '.uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
),
$queryBuilder->expr()->eq(
'sys_category_record_mm.tablenames',
Expand Down
5 changes: 2 additions & 3 deletions Classes/Domain/Repository/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Tpwd\KeSearch\Domain\Repository;

use PDO;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand Down Expand Up @@ -66,7 +65,7 @@ public function findOneByUid($uid)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down Expand Up @@ -94,7 +93,7 @@ public function findNewestByPid($pid, $removeRestrictions = false)
->where(
$queryBuilder->expr()->eq(
'pid',
$queryBuilder->createNamedParameter($pid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)
)
)
->orderBy('tstamp', 'DESC')
Expand Down
5 changes: 2 additions & 3 deletions Classes/Domain/Repository/FileMetaDataRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Tpwd\KeSearch\Domain\Repository;

use Doctrine\DBAL\Driver\Exception;
use PDO;

/***************************************************************
* Copyright notice
Expand Down Expand Up @@ -49,11 +48,11 @@ public function findByFileUidAndLanguageUid(int $fileUid, $languageUid)
->where(
$queryBuilder->expr()->eq(
'file',
$queryBuilder->createNamedParameter($fileUid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($fileUid, \PDO::PARAM_INT)
),
$queryBuilder->expr()->eq(
'sys_language_uid',
$queryBuilder->createNamedParameter($languageUid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($languageUid, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down
7 changes: 3 additions & 4 deletions Classes/Domain/Repository/FileReferenceRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Tpwd\KeSearch\Domain\Repository;

use Doctrine\DBAL\Connection as DoctrineDbalConnection;
use PDO;

/***************************************************************
* Copyright notice
Expand Down Expand Up @@ -56,19 +55,19 @@ public function findOneByTableAndFieldnameAndUidForeignAndLanguage(
),
$queryBuilder->expr()->eq(
'uid_foreign',
$queryBuilder->createNamedParameter($uid_foreign, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid_foreign, \PDO::PARAM_INT)
),
$queryBuilder->expr()->in(
'sys_language_uid',
$queryBuilder->createNamedParameter($languageIds, DoctrineDbalConnection::PARAM_INT_ARRAY)
),
$queryBuilder->expr()->eq(
't3ver_state',
$queryBuilder->createNamedParameter(0, PDO::PARAM_INT)
$queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
),
$queryBuilder->expr()->eq(
't3ver_wsid',
$queryBuilder->createNamedParameter(0, PDO::PARAM_INT)
$queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
)
)
->orderBy('sorting_foreign', 'asc')
Expand Down
19 changes: 9 additions & 10 deletions Classes/Domain/Repository/FilterOptionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Tpwd\KeSearch\Domain\Repository;

use Doctrine\DBAL\Driver\Statement;
use PDO;
use Tpwd\KeSearch\Lib\SearchHelper;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Database\Connection;
Expand Down Expand Up @@ -64,7 +63,7 @@ public function findByTagPrefix(string $tagPrefix, bool $includeHiddenAndTimeRes
->where(
$queryBuilder->expr()->like(
'tag',
$queryBuilder->createNamedParameter($tagPrefix . '%', PDO::PARAM_STR)
$queryBuilder->createNamedParameter($tagPrefix . '%', \PDO::PARAM_STR)
)
)
->executeQuery()
Expand All @@ -89,11 +88,11 @@ public function findByTagPrefixAndLanguage(
->where(
$queryBuilder->expr()->like(
'tag',
$queryBuilder->createNamedParameter($tagPrefix . '%', PDO::PARAM_STR)
$queryBuilder->createNamedParameter($tagPrefix . '%', \PDO::PARAM_STR)
),
$queryBuilder->expr()->eq(
'sys_language_uid',
$queryBuilder->createNamedParameter($sys_language_uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($sys_language_uid, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down Expand Up @@ -148,7 +147,7 @@ public function findByL10nParent(int $l10n_parent, bool $includeHiddenAndTimeRes
->where(
$queryBuilder->expr()->eq(
'l10n_parent',
$queryBuilder->createNamedParameter($l10n_parent, PDO::PARAM_STR)
$queryBuilder->createNamedParameter($l10n_parent, \PDO::PARAM_STR)
)
)
->executeQuery()
Expand All @@ -169,7 +168,7 @@ public function findByTag(string $tag, bool $includeHiddenAndTimeRestricted = fa
->where(
$queryBuilder->expr()->eq(
'tag',
$queryBuilder->createNamedParameter($tag, PDO::PARAM_STR)
$queryBuilder->createNamedParameter($tag, \PDO::PARAM_STR)
)
)
->executeQuery()
Expand All @@ -194,11 +193,11 @@ public function findByTagAndLanguage(
->where(
$queryBuilder->expr()->eq(
'tag',
$queryBuilder->createNamedParameter($tag, PDO::PARAM_STR)
$queryBuilder->createNamedParameter($tag, \PDO::PARAM_STR)
),
$queryBuilder->expr()->eq(
'sys_language_uid',
$queryBuilder->createNamedParameter($sys_language_uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($sys_language_uid, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down Expand Up @@ -294,7 +293,7 @@ public function deleteByUid(int $filterOptionUid)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($filterOptionUid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($filterOptionUid, \PDO::PARAM_INT)
)
)
->executeStatement();
Expand Down Expand Up @@ -344,7 +343,7 @@ public function update(int $uid, array $updateFields)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
)
);
foreach ($updateFields as $key => $value) {
Expand Down
9 changes: 4 additions & 5 deletions Classes/Domain/Repository/GenericRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tpwd\KeSearch\Domain\Repository;

use PDO;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction;
Expand Down Expand Up @@ -84,7 +83,7 @@ public function findByUidAndType($uid, string $type)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down Expand Up @@ -113,11 +112,11 @@ public function findLangaugeOverlayByUidAndLanguage(string $table, int $uid, int
->where(
$queryBuilder->expr()->eq(
$transOrigPointerField,
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
),
$queryBuilder->expr()->eq(
$languageField,
$queryBuilder->createNamedParameter($languageId, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($languageId, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down Expand Up @@ -154,7 +153,7 @@ public function findByReferenceField(
->where(
$queryBuilder->expr()->eq(
$fieldName,
$queryBuilder->createNamedParameter($value, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($value, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down
17 changes: 8 additions & 9 deletions Classes/Domain/Repository/IndexRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Tpwd\KeSearch\Domain\Repository;

use Doctrine\DBAL\Driver\Statement;
use PDO;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand Down Expand Up @@ -56,7 +55,7 @@ public function findByUid(int $uid)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down Expand Up @@ -101,7 +100,7 @@ public function update(int $uid, array $updateFields)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
)
);
foreach ($updateFields as $key => $value) {
Expand Down Expand Up @@ -159,7 +158,7 @@ public function deleteByUid(int $uid)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
)
)
->executeStatement();
Expand All @@ -181,10 +180,10 @@ public function deleteByUniqueProperties(int $origUid, int $pid, string $type, i
return $queryBuilder
->delete($this->tableName)
->where(
$queryBuilder->expr()->eq('orig_uid', $queryBuilder->createNamedParameter($origUid, PDO::PARAM_INT)),
$queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, PDO::PARAM_INT)),
$queryBuilder->expr()->eq('orig_uid', $queryBuilder->createNamedParameter($origUid, \PDO::PARAM_INT)),
$queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)),
$queryBuilder->expr()->eq('type', $queryBuilder->createNamedParameter($type)),
$queryBuilder->expr()->eq('language', $queryBuilder->createNamedParameter($language, PDO::PARAM_INT))
$queryBuilder->expr()->eq('language', $queryBuilder->createNamedParameter($language, \PDO::PARAM_INT))
)
->executeStatement();
}
Expand Down Expand Up @@ -243,11 +242,11 @@ public function findOutdatedFileRecordsByPidAndTimestamp(int $pid, int $timestam
),
$queryBuilder->expr()->eq(
'pid',
$queryBuilder->createNamedParameter($pid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)
),
$queryBuilder->expr()->lt(
'tstamp',
$queryBuilder->createNamedParameter($timestamp, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($timestamp, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand Down
3 changes: 1 addition & 2 deletions Classes/Domain/Repository/PageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Tpwd\KeSearch\Domain\Repository;

use PDO;
use TYPO3\CMS\Core\Database\Connection;

/***************************************************************
Expand Down Expand Up @@ -59,7 +58,7 @@ public function findAllDeletedAndHiddenByUidListAndTimestampInAllLanguages(array
. ' OR '
. $queryBuilder->expr()->eq('hidden', 1)
. ')',
$queryBuilder->expr()->gte('tstamp', $queryBuilder->createNamedParameter($tstamp, PDO::PARAM_INT))
$queryBuilder->expr()->gte('tstamp', $queryBuilder->createNamedParameter($tstamp, \PDO::PARAM_INT))
)
->executeQuery()
->fetchAllAssociative();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tpwd\KeSearch\Domain\Repository;

use PDO;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -50,7 +49,7 @@ public function findByUid(int $uid)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
)
)
->executeQuery()
Expand All @@ -72,7 +71,7 @@ public function update(int $uid, array $updateFields)
->where(
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($uid, PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
)
);
foreach ($updateFields as $key => $value) {
Expand Down Expand Up @@ -103,7 +102,7 @@ public function findAllByNumberOfDays($days = 7): array
->from($this->tableName)
->add(
'where',
'tstamp > ' . $queryBuilder->quote($startTime, PDO::PARAM_INT)
'tstamp > ' . $queryBuilder->quote($startTime, \PDO::PARAM_INT)
)
->add('groupBy', $col . ',language HAVING count(' . $col . ')>0')
->add('orderBy', 'num desc')
Expand Down
Loading

0 comments on commit 7ee474b

Please sign in to comment.