Skip to content

Commit 25f4afd

Browse files
committed
Merge branch '4.6'
2 parents ac307fd + 927f626 commit 25f4afd

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

phpstan-baseline.neon

+2-7
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,12 @@ parameters:
231231
path: src/bundle/IbexaSearchBundle.php
232232

233233
-
234-
message: "#^Method Ibexa\\\\Search\\\\Mapper\\\\PagerSearchContentToDataMapper\\:\\:map\\(\\) has parameter \\$pager with generic class Pagerfanta\\\\Pagerfanta but does not specify its types\\: T$#"
235-
count: 1
236-
path: src/lib/Mapper/PagerSearchContentToDataMapper.php
237-
238-
-
239-
message: "#^Method Ibexa\\\\Search\\\\Mapper\\\\PagerSearchContentToDataMapper\\:\\:map\\(\\) return type has no value type specified in iterable type array\\.$#"
234+
message: "#^Cannot access offset int on iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ContentType\\\\ContentType\\>\\.$#"
240235
count: 1
241236
path: src/lib/Mapper/PagerSearchContentToDataMapper.php
242237

243238
-
244-
message: "#^Method Ibexa\\\\Search\\\\Mapper\\\\PagerSearchContentToDataMapper\\:\\:setTranslatedContentTypesNames\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#"
239+
message: "#^Method Ibexa\\\\Search\\\\Mapper\\\\PagerSearchContentToDataMapper\\:\\:map\\(\\) has parameter \\$pager with generic class Pagerfanta\\\\Pagerfanta but does not specify its types\\: T$#"
245240
count: 1
246241
path: src/lib/Mapper/PagerSearchContentToDataMapper.php
247242

src/contracts/Event/BuildSuggestionCollectionEvent.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111
use Ibexa\Contracts\Search\Model\Suggestion\SuggestionCollection;
1212
use Ibexa\Search\Model\SuggestionQuery;
13+
use Symfony\Contracts\EventDispatcher\Event;
1314

14-
final class BuildSuggestionCollectionEvent
15+
final class BuildSuggestionCollectionEvent extends Event
1516
{
1617
private SuggestionCollection $suggestionCollection;
1718

src/lib/Mapper/PagerSearchContentToDataMapper.php

+24-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@
2121
use Ibexa\Core\Repository\LocationResolver\LocationResolver;
2222
use Pagerfanta\Pagerfanta;
2323

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+
*/
2443
class PagerSearchContentToDataMapper
2544
{
2645
/** @var \Ibexa\Contracts\Core\Repository\ContentTypeService */
@@ -57,6 +76,9 @@ public function __construct(
5776
$this->locationResolver = $locationResolver;
5877
}
5978

79+
/**
80+
* @phpstan-return TData[]
81+
*/
6082
public function map(Pagerfanta $pager): array
6183
{
6284
$data = [];
@@ -138,8 +160,8 @@ protected function getContributor(ContentInfo $contentInfo): ?User
138160
}
139161

140162
/**
141-
* @param array $data
142-
* @param int[] $contentTypeIds
163+
* @phpstan-param TData[] $data
164+
* @phpstan-param int[] $contentTypeIds
143165
*/
144166
protected function setTranslatedContentTypesNames(array &$data, array $contentTypeIds): void
145167
{

0 commit comments

Comments
 (0)