Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"require-dev": {
"ibexa/code-style": "~2.0.0",
"ibexa/doctrine-schema": "~6.0.x-dev",
"ibexa/phpstan": "~6.0.x-dev",
"ibexa/rector": "~6.0.x-dev",
"matthiasnoback/symfony-dependency-injection-test": "^6.0",
"phpstan/phpstan": "^2.0",
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ includes:
- phpstan-baseline.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/ibexa/phpstan/extension.neon

parameters:
level: 8
Expand Down
6 changes: 4 additions & 2 deletions src/bundle/Form/DataTransformer/UsersTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Ibexa\Contracts\Core\Repository\Values\Content\Query;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LogicalAnd;
use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchHit;
use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult;
use Ibexa\Contracts\Core\Repository\Values\ValueObject;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;

Expand Down Expand Up @@ -76,14 +78,14 @@ public function reverseTransform(mixed $value): SearchUsersData

$searchService = $this->searchService;

$result = $this->repository->sudo(static function () use ($searchService, $filter) {
$result = $this->repository->sudo(static function () use ($searchService, $filter): SearchResult {
return $searchService->findContent(new Query([
'filter' => $filter,
]));
});

return new SearchUsersData(
array_map(static function (SearchHit $searchHit) {
array_map(static function (SearchHit $searchHit): ValueObject {
return $searchHit->valueObject;
}, $result->searchHits),
$value
Expand Down
4 changes: 2 additions & 2 deletions tests/contracts/Model/Suggestion/SuggestionCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function testCollection(): void
self::assertInstanceOf(MutableArrayList::class, $collection);
self::assertInstanceOf(SuggestionCollection::class, $collection);

$contentMock = $this->createStub(Content::class);
$contentTypeMock = $this->createStub(ContentType::class);
$contentMock = self::createStub(Content::class);
$contentTypeMock = self::createStub(ContentType::class);

$collection->append(new ContentSuggestion(10, $contentMock, $contentTypeMock, '1/2/3', [new Location()]));
$collection->append(new ContentSuggestion(20, $contentMock, $contentTypeMock, '1/3/5', [new Location()]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private function getSearchServiceMock(): SearchService
->method('findContent')->willReturnCallback(function (Query $query): SearchResult {
$this->capturedQuery = $query;

return new SearchResult(['searchHits' => [$this->createStub(SearchHit::class)]]);
return new SearchResult(['searchHits' => [self::createStub(SearchHit::class)]]);
});

return $searchServiceMock;
Expand Down Expand Up @@ -191,8 +191,8 @@ private function getSearchHitToContentSuggestionMapperMock(): SearchHitToContent
->willReturn(
new ContentSuggestionModel(
10.0,
$this->createStub(Content::class),
$this->createStub(ContentType::class),
self::createStub(Content::class),
self::createStub(ContentType::class),
'1/2/3',
[
new Location(['id' => 1, 'path' => [1, 2, 3]]),
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/QueryType/SearchQueryTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class SearchQueryTypeTest extends TestCase
protected function setUp(): void
{
$this->searchService = $this->createMock(SearchService::class);
$this->sortingDefinitionRegistry = $this->createStub(SortingDefinitionRegistryInterface::class);
$this->sortingDefinitionRegistry = self::createStub(SortingDefinitionRegistryInterface::class);
$this->queryType = new SearchQueryType(
$this->searchService,
$this->sortingDefinitionRegistry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function setUp(): void

public function testNormalize(): void
{
$suggestionItemMock = $this->createStub(Suggestion::class);
$suggestionItemMock = self::createStub(Suggestion::class);
$suggestionCollection = new SuggestionCollection([$suggestionItemMock]);
$suggestionCollection->increaseTotalCount(100);

Expand Down
Loading