Skip to content

Commit

Permalink
Corrected CS
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszdebinski committed Mar 4, 2024
1 parent d1affaa commit 1381a78
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 27 deletions.
3 changes: 0 additions & 3 deletions src/lib/Persistence/Cache/ContentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,6 @@ public function loadRelations($sourceContentId, $sourceContentVersionNo = null,
return $this->persistenceHandler->contentHandler()->loadRelations($sourceContentId, $sourceContentVersionNo, $type);
}

/**
* {@inheritdoc}
*/
public function countRelations(int $sourceContentId, ?int $sourceContentVersionNo = null, ?int $type = null): int
{
$cacheItem = $this->cache->getItem(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Persistence/Legacy/Content/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ abstract public function countRelations(
/**
* Loads paginated data of related to/from $contentId.
*
* @return array<mixed>
* @return array<array<string, mixed>>
*/
abstract public function listRelations(
int $contentId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ public function countRelations(
'ezcontentobject_to.status = :status'
)
)
->where(
->andWhere(
'l.from_contentobject_id = :content_id'
)
->setParameter(
Expand Down Expand Up @@ -1533,7 +1533,7 @@ public function listRelations(
$expr->eq('ezcontentobject_to.status', ':status'),
)
)
->where(
->andWhere(
'l.from_contentobject_id = :content_id'
)
->setParameter(
Expand Down
3 changes: 0 additions & 3 deletions src/lib/Persistence/Legacy/Content/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,6 @@ public function loadRelations($sourceContentId, $sourceContentVersionNo = null,
);
}

/**
* {@inheritdoc}
*/
public function countRelations(int $sourceContentId, ?int $sourceContentVersionNo = null, ?int $type = null): int
{
return $this->contentGateway->countRelations($sourceContentId, $sourceContentVersionNo, $type);
Expand Down
3 changes: 0 additions & 3 deletions src/lib/Repository/ContentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2048,9 +2048,6 @@ protected function internalLoadRelations(APIVersionInfo $versionInfo): array
return $relations;
}

/**
* {@inheritdoc}
*/
public function countRelations(APIVersionInfo $versionInfo): int
{
$function = 'versionread';
Expand Down
15 changes: 0 additions & 15 deletions tests/integration/Core/Repository/ContentServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3683,29 +3683,20 @@ public function testLoadRelationsSkipsDraftContent()
);
}

/**
* @covers \Ibexa\Contracts\Core\Repository\ContentService::countRelations
*/
public function testCountRelations(): void
{
$draft = $this->createContentWithRelations();

self::assertEquals(2, $this->contentService->countRelations($draft->getVersionInfo()));
}

/**
* @covers \Ibexa\Contracts\Core\Repository\ContentService::countRelations
*/
public function testCountRelationsReturnsZeroByDefault(): void
{
$draft = $this->createContentDraftVersion1();

self::assertSame(0, $this->contentService->countRelations($draft->getVersionInfo()));
}

/**
* @covers \Ibexa\Contracts\Core\Repository\ContentService::countRelations
*/
public function testCountRelationsForUnauthorizedUser(): void
{
$draft = $this->createContentWithRelations();
Expand All @@ -3715,9 +3706,6 @@ public function testCountRelationsForUnauthorizedUser(): void
self::assertSame(0, $this->contentService->countRelations($draft->getVersionInfo()));
}

/**
* @covers \Ibexa\Contracts\Core\Repository\ContentService::loadRelationList
*/
public function testLoadRelationList(): void
{
$draft = $this->createContentWithRelations();
Expand All @@ -3744,9 +3732,6 @@ public function testLoadRelationList(): void
);
}

/**
* @covers \Ibexa\Contracts\Core\Repository\ContentService::loadRelationList
*/
public function testLoadRelationListWithPagination(): void
{
$draft = $this->createContentWithRelations();
Expand Down

0 comments on commit 1381a78

Please sign in to comment.