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 b112b18
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions Content/Domain/Repository/ContentRichEntityRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?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{
* title?: 'asc'|'desc',
* authored?: 'asc'|'desc',
* workflowPublished?: 'asc'|'desc',
* }
*
* @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 65 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 = [],
array $selects = [],
): iterable;

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

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 #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 b112b18

Please sign in to comment.