Skip to content

Commit

Permalink
[TASK] Sync with EXT:solr addons :: Fix Type-Hinting for AfterIndexQu…
Browse files Browse the repository at this point in the history
…eueItemHasBeenMarkedForReindexingEvent
  • Loading branch information
dkd-kaehm committed Aug 15, 2023
1 parent aee51e4 commit d96e4eb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Expand Up @@ -27,7 +27,7 @@ final class AfterIndexQueueItemHasBeenMarkedForReindexingEvent
{
public function __construct(
private readonly string $itemType,
private readonly int|string $itemUid,
private readonly int $itemUid,
private readonly int $forcedChangeTime,
private int $updateCount
) {
Expand All @@ -38,7 +38,7 @@ public function getItemType(): string
return $this->itemType;
}

public function getItemUid(): int|string
public function getItemUid(): int
{
return $this->itemUid;
}
Expand Down
24 changes: 13 additions & 11 deletions Classes/IndexQueue/Queue.php
Expand Up @@ -134,7 +134,7 @@ public function getInitializationService(): QueueInitializationService
*/
public function updateItem(
string $itemType,
int|string $itemUid,
int $itemUid,
int $forcedChangeTime = 0,
): int {
$updateCount = $this->updateOrAddItemForAllRelatedRootPages($itemType, $itemUid, $forcedChangeTime);
Expand All @@ -151,7 +151,7 @@ public function updateItem(
*/
protected function updateOrAddItemForAllRelatedRootPages(
string $itemType,
int|string $itemUid,
int $itemUid,
int $forcedChangeTime,
): int {
$updateCount = 0;
Expand Down Expand Up @@ -239,7 +239,7 @@ public function resetErrorByItem(Item $item): int
*/
private function addNewItem(
string $itemType,
int|string $itemUid,
int $itemUid,
string $indexingConfiguration,
int $rootPageId,
int $indexingPriority = 0
Expand All @@ -265,7 +265,7 @@ private function addNewItem(
*/
protected function getRecordCached(
string $itemType,
int|string $itemUid,
int $itemUid,
string $additionalRecordFields,
): ?array {
$cache = GeneralUtility::makeInstance(TwoLevelCache::class, 'runtime');
Expand Down Expand Up @@ -293,7 +293,7 @@ protected function getRecordCached(
*/
protected function getItemChangedTime(
string $itemType,
int|string $itemUid,
int $itemUid,
): int {
$itemTypeHasStartTimeColumn = false;
$changedTimeColumns = $GLOBALS['TCA'][$itemType]['ctrl']['tstamp'];
Expand Down Expand Up @@ -358,7 +358,7 @@ protected function getPageItemChangedTime(array $page): int
*/
public function containsItem(
string $itemType,
int|string $itemUid
int $itemUid,
): bool {
return $this->queueItemRepository->containsItem($itemType, (int)$itemUid);
}
Expand All @@ -370,7 +370,7 @@ public function containsItem(
*/
public function containsItemWithRootPageId(
string $itemType,
int|string $itemUid,
int $itemUid,
int $rootPageId,
): bool {
return $this->queueItemRepository->containsItemWithRootPageId($itemType, (int)$itemUid, $rootPageId);
Expand All @@ -384,7 +384,7 @@ public function containsItemWithRootPageId(
*/
public function containsIndexedItem(
string $itemType,
int|string $itemUid,
int $itemUid,
): bool {
return $this->queueItemRepository->containsIndexedItem($itemType, (int)$itemUid);
}
Expand All @@ -396,7 +396,7 @@ public function containsIndexedItem(
*/
public function deleteItem(
string $itemType,
int|string $itemUid,
int $itemUid,
): void {
$this->queueItemRepository->deleteItem($itemType, (int)$itemUid);
}
Expand Down Expand Up @@ -449,8 +449,10 @@ public function getItem(int $itemId): ?Item
*
* @throws DBALException
*/
public function getItems(string $itemType, int|string $itemUid): array
{
public function getItems(
string $itemType,
int $itemUid,
): array {
return $this->queueItemRepository->findItemsByItemTypeAndItemUid($itemType, (int)$itemUid);
}

Expand Down

0 comments on commit d96e4eb

Please sign in to comment.