Skip to content

Commit

Permalink
Add interface for ContentRichEntityRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Aug 9, 2024
1 parent f36e36d commit e1e76e1
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions Content/Domain/Repository/ContentRichEntityRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php

declare(strict_types=1);

/*
* This file is part of Sulu.
*
* (c) Sulu GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Sulu\Bundle\ContentBundle\Content\Domain\Repository;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;

/**
* @template T of ContentRichEntityInterface
*
* @phpstan-type ContentRichEntityRepositoryFilters array{
* ids: array<string>,
* locale?: string|null,
* stage?: string|null,
* categoryIds?: int[],
* categoryKeys?: string[],
* categoryOperator?: 'AND'|'OR',
* tagIds?: int[],
* tagNames?: string[],
* tagOperator?: 'AND'|'OR',
* templateKeys?: string[],
* loadGhost?: bool,
* }
*
* @phpstan-type ContentRichEntityRepositorySortBys array{
* ids: array<string>,
* locale?: string|null,
* stage?: string|null,
* categoryIds?: int[],
* categoryKeys?: string[],
* categoryOperator?: 'AND'|'OR',
* tagIds?: int[],
* tagNames?: string[],
* tagOperator?: 'AND'|'OR',
* templateKeys?: string[],
* loadGhost?: bool,
* }
*
* @phpstan-type ContentRichEntityRepositorySelects array{
* content_admin?: bool,
* content_website?: bool,
* with-excerpt-tags?: bool,
* with-excerpt-categories?: bool,
* with-excerpt-categories-translation?: bool,
* with-excerpt-image?: bool,
* with-excerpt-image-translation?: bool,
* with-excerpt-icon?: bool,
* with-excerpt-icon-translation?: bool,
* }
*/
interface ContentRichEntityRepositoryInterface
{
/**
* @param ContentRichEntityRepositoryFilters $filters
*
* @param ContentRichEntityRepositorySortBys $sortBys
*
* @param ContentRichEntityRepositorySelects $selects
*
* @return iterable<T>
*/
public function findBy(
array $filters = [],

Check failure on line 73 in Content/Domain/Repository/ContentRichEntityRepositoryInterface.php

View workflow job for this annotation

GitHub Actions / PHP Lint

Default value of the parameter #1 $filters (array{}) of method Sulu\Bundle\ContentBundle\Content\Domain\Repository\ContentRichEntityRepositoryInterface::findBy() is incompatible with type array{ids: array<string>, locale?: string|null, stage?: string|null, categoryIds?: array<int>, categoryKeys?: array<string>, categoryOperator?: 'AND'|'OR', tagIds?: array<int>, tagNames?: array<string>, ...}.
array $sortBys = [],

Check failure on line 74 in Content/Domain/Repository/ContentRichEntityRepositoryInterface.php

View workflow job for this annotation

GitHub Actions / PHP Lint

Default value of the parameter #2 $sortBys (array{}) of method Sulu\Bundle\ContentBundle\Content\Domain\Repository\ContentRichEntityRepositoryInterface::findBy() is incompatible with type array{ids: array<string>, locale?: string|null, stage?: string|null, categoryIds?: array<int>, categoryKeys?: array<string>, categoryOperator?: 'AND'|'OR', tagIds?: array<int>, tagNames?: array<string>, ...}.
array $selects = [],
): iterable;

/**
* @param ContentRichEntityRepositoryFilters $filters
*/
public function countBy(
array $filters = [],

Check failure on line 82 in Content/Domain/Repository/ContentRichEntityRepositoryInterface.php

View workflow job for this annotation

GitHub Actions / PHP Lint

Default value of the parameter #1 $filters (array{}) of method Sulu\Bundle\ContentBundle\Content\Domain\Repository\ContentRichEntityRepositoryInterface::countBy() is incompatible with type array{ids: array<string>, locale?: string|null, stage?: string|null, categoryIds?: array<int>, categoryKeys?: array<string>, categoryOperator?: 'AND'|'OR', tagIds?: array<int>, tagNames?: array<string>, ...}.
): int;
}

0 comments on commit e1e76e1

Please sign in to comment.