|
21 | 21 | use Ibexa\Core\Repository\LocationResolver\LocationResolver;
|
22 | 22 | use Pagerfanta\Pagerfanta;
|
23 | 23 |
|
| 24 | +/** |
| 25 | + * @phpstan-type TData = array{ |
| 26 | + * content: \Ibexa\Contracts\Core\Repository\Values\Content\Content, |
| 27 | + * contentTypeId: int, |
| 28 | + * contentId: int, |
| 29 | + * name: string, |
| 30 | + * language: string, |
| 31 | + * contributor: \Ibexa\Contracts\Core\Repository\Values\User\User|null, |
| 32 | + * version: int, |
| 33 | + * content_type: \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType, |
| 34 | + * modified: \DateTimeInterface, |
| 35 | + * initialLanguageCode: string, |
| 36 | + * content_is_user: bool, |
| 37 | + * available_enabled_translations: iterable<\Ibexa\Contracts\Core\Repository\Values\Content\Language>, |
| 38 | + * available_translations: iterable<\Ibexa\Contracts\Core\Repository\Values\Content\Language>, |
| 39 | + * translation_language_code: string, |
| 40 | + * resolvedLocation: \Ibexa\Contracts\Core\Repository\Values\Content\Location |
| 41 | + * } |
| 42 | + */ |
24 | 43 | class PagerSearchContentToDataMapper
|
25 | 44 | {
|
26 | 45 | /** @var \Ibexa\Contracts\Core\Repository\ContentTypeService */
|
@@ -57,6 +76,9 @@ public function __construct(
|
57 | 76 | $this->locationResolver = $locationResolver;
|
58 | 77 | }
|
59 | 78 |
|
| 79 | + /** |
| 80 | + * @phpstan-return TData[] |
| 81 | + */ |
60 | 82 | public function map(Pagerfanta $pager): array
|
61 | 83 | {
|
62 | 84 | $data = [];
|
@@ -138,8 +160,8 @@ protected function getContributor(ContentInfo $contentInfo): ?User
|
138 | 160 | }
|
139 | 161 |
|
140 | 162 | /**
|
141 |
| - * @param array $data |
142 |
| - * @param int[] $contentTypeIds |
| 163 | + * @phpstan-param TData[] $data |
| 164 | + * @phpstan-param int[] $contentTypeIds |
143 | 165 | */
|
144 | 166 | protected function setTranslatedContentTypesNames(array &$data, array $contentTypeIds): void
|
145 | 167 | {
|
|
0 commit comments