Skip to content
Draft
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"require-dev": {
"behat/behat": "^3.6.1",
"friends-of-behat/mink-extension": "^2.4",
"ibexa/code-style": "^2.2.x-dev",
"ibexa/code-style": "dev-bump-php-cs-fixer-to-v3.89.0 as 2.2.x-dev",
"ibexa/rector": "~5.0.x-dev",
"jenner/simple_fork": "^1.2",
"matthiasnoback/symfony-dependency-injection-test": "^5.0",
Expand Down
6 changes: 4 additions & 2 deletions src/contracts/Repository/PermissionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

use Ibexa\Contracts\Core\Repository\Exceptions\BadStateException;
use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException;
use Ibexa\Contracts\Core\Repository\Values\User\Limitation;
use Ibexa\Contracts\Core\Repository\Values\User\LookupLimitationResult;
use Ibexa\Contracts\Core\Repository\Values\User\Policy;
use Ibexa\Contracts\Core\Repository\Values\User\UserReference;

/**
Expand Down Expand Up @@ -48,8 +50,8 @@ public function setCurrentUserReference(UserReference $userReference): void;
*
* @phpstan-return bool|array<
* array{
* limitation: \Ibexa\Contracts\Core\Repository\Values\User\Limitation|null,
* policies: array<\Ibexa\Contracts\Core\Repository\Values\User\Policy>
* limitation: Limitation|null,
* policies: array<Policy>
* },
* >
*/
Expand Down
2 changes: 1 addition & 1 deletion src/lib/MVC/Symfony/Component/Serializer/MapNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class MapNormalizer implements NormalizerInterface, DenormalizerInterface
* @param Map $data
*
* @return array{
* type: class-string<\Ibexa\Core\MVC\Symfony\SiteAccess\Matcher\Map>,
* type: class-string<Map>,
* key: string|null,
* map: array{},
* reverseMap: array{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Ibexa\Core\MVC\Symfony\Component\Serializer;

use Ibexa\Core\MVC\Symfony\SiteAccess;
use Ibexa\Core\MVC\Symfony\SiteAccess\Matcher;
use Ibexa\Core\MVC\Symfony\SiteAccessGroup;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
Expand Down Expand Up @@ -77,9 +78,9 @@ public function supportsNormalization(
* @return array{
* name: string,
* matchingType: string,
* matcher: array{type: class-string<\Ibexa\Core\MVC\Symfony\SiteAccess\Matcher>, data: string|null}|null,
* matcher: array{type: class-string<Matcher>, data: string|null}|null,
* provider: string|null,
* groups: array<\Ibexa\Core\MVC\Symfony\SiteAccessGroup>
* groups: array<SiteAccessGroup>
* }
*/
public function normalize(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Repository/Validator/VersionValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function supports(ValueObject $object): bool

/**
* @phpstan-param array{
* content?: \Ibexa\Contracts\Core\Repository\Values\Content\Content,
* content?: Content,
* translations?: string[],
* } $context
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public function testResolve(): void

/**
* @return iterable<array{
* \Symfony\Component\HttpFoundation\Request,
* \Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata
* Request,
* ArgumentMetadata
* }>
*/
public function dataProviderForTestResolverForUnsupportedRequest(): iterable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ private function runCommonStoreFieldDataMocks(Field $field): BinaryFile

/**
* @return iterable<array{
* \Ibexa\Contracts\Core\Persistence\Content\VersionInfo,
* \Ibexa\Contracts\Core\Persistence\Content\Field
* VersionInfo,
* Field
* }>
*/
public function providerOfFieldData(): iterable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function getValidValidatorConfiguration(): array
*
* @return array{
* StringLengthValidator: array{
* minStringLength: \stdClass,
* minStringLength: stdClass,
* },
* }
*/
Expand Down Expand Up @@ -487,7 +487,7 @@ public function testInherentCopyForNewLanguage(): void

/**
* @return array<array{
* \Ibexa\Core\FieldType\Image\Value
* ImageValue
* }>
*/
public function providerForTestIsEmptyValue(): array
Expand All @@ -499,7 +499,7 @@ public function providerForTestIsEmptyValue(): array

/**
* @return array<array{
* \Ibexa\Core\FieldType\Image\Value
* ImageValue
* }>
*/
public function providerForTestIsNotEmptyValue(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testCriterion(
/**
* @return iterable<array{
* int,
* array<\Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion>
* array<Criterion>
* }>
*/
public function provideDataForTestCriterion(): iterable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static function (SearchHit $searchHit) use ($languageCode): ?string {

/**
* @return iterable<array{
* \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion,
* Criterion,
* ?string,
* array<string>,
* int,
Expand Down
37 changes: 19 additions & 18 deletions tests/integration/Core/Repository/SearchServiceImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException;
use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException;
use Ibexa\Contracts\Core\Repository\Values\Content\Query;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeDraft;
use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition;
Expand Down Expand Up @@ -47,16 +48,16 @@ protected function setUp(): void
*/
public function testCriterion(
int $expectedCount,
Query\Criterion $imageCriterion
Criterion $imageCriterion
): void {
if (getenv('SEARCH_ENGINE') === 'legacy') {
self::markTestSkipped('Image criteria are not supported in Legacy Search Engine');
}

$query = new Query();
$query->filter = new Query\Criterion\LogicalAnd(
$query->filter = new Criterion\LogicalAnd(
[
new Query\Criterion\ContentTypeIdentifier(self::IMAGE_CONTENT_TYPE),
new Criterion\ContentTypeIdentifier(self::IMAGE_CONTENT_TYPE),
$imageCriterion,
]
);
Expand All @@ -72,7 +73,7 @@ public function testCriterion(
/**
* @return iterable<array{
* int,
* \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion
* Criterion
* }>
*/
public function provideDataForTestCriterion(): iterable
Expand Down Expand Up @@ -175,7 +176,7 @@ public function provideDataForTestCriterion(): iterable

yield 'Image' => [
2,
new Query\Criterion\Image(
new Criterion\Image(
self::IMAGE_FIELD_DEF_IDENTIFIER,
[
'mimeTypes' => [
Expand Down Expand Up @@ -206,7 +207,7 @@ public function provideDataForTestCriterion(): iterable
/**
* @return iterable<array{
* int,
* \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion
* Criterion
* }>
*/
public function provideInvalidDataForTestCriterion(): iterable
Expand Down Expand Up @@ -258,9 +259,9 @@ public function provideInvalidDataForTestCriterion(): iterable
/**
* @param string|array<string> $value
*/
private function createMimeTypeCriterion($value): Query\Criterion\Image\MimeType
private function createMimeTypeCriterion($value): Criterion\Image\MimeType
{
return new Query\Criterion\Image\MimeType(
return new Criterion\Image\MimeType(
self::IMAGE_FIELD_DEF_IDENTIFIER,
$value
);
Expand All @@ -273,8 +274,8 @@ private function createMimeTypeCriterion($value): Query\Criterion\Image\MimeType
private function createFileSizeCriterion(
$min = 0,
$max = null
): Query\Criterion\Image\FileSize {
return new Query\Criterion\Image\FileSize(
): Criterion\Image\FileSize {
return new Criterion\Image\FileSize(
self::IMAGE_FIELD_DEF_IDENTIFIER,
$min,
$max
Expand All @@ -284,8 +285,8 @@ private function createFileSizeCriterion(
private function createWidthCriterion(
int $min = 0,
?int $max = null
): Query\Criterion\Image\Width {
return new Query\Criterion\Image\Width(
): Criterion\Image\Width {
return new Criterion\Image\Width(
self::IMAGE_FIELD_DEF_IDENTIFIER,
$min,
$max
Expand All @@ -295,8 +296,8 @@ private function createWidthCriterion(
private function createHeightCriterion(
int $min = 0,
?int $max = null
): Query\Criterion\Image\Height {
return new Query\Criterion\Image\Height(
): Criterion\Image\Height {
return new Criterion\Image\Height(
self::IMAGE_FIELD_DEF_IDENTIFIER,
$min,
$max
Expand All @@ -308,8 +309,8 @@ private function createDimensionsCriterion(
int $maxWidth,
int $minHeight,
int $maxHeight
): Query\Criterion\Image\Dimensions {
return new Query\Criterion\Image\Dimensions(
): Criterion\Image\Dimensions {
return new Criterion\Image\Dimensions(
self::IMAGE_FIELD_DEF_IDENTIFIER,
[
'width' => [
Expand All @@ -327,9 +328,9 @@ private function createDimensionsCriterion(
/**
* @param string|array<string> $value
*/
private function createOrientationCriterion($value): Query\Criterion\Image\Orientation
private function createOrientationCriterion($value): Criterion\Image\Orientation
{
return new Query\Criterion\Image\Orientation(
return new Criterion\Image\Orientation(
self::IMAGE_FIELD_DEF_IDENTIFIER,
$value
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function setUp(): void

/**
* @return array<array{
* 0: \Ibexa\Contracts\Core\Repository\Values\User\User,
* 0: User,
* 1: int,
* 2: int[]
* }>
Expand All @@ -66,7 +66,7 @@ public function getDataForGrantedAccess(): array

/**
* @return array<array{
* 0: \Ibexa\Contracts\Core\Repository\Values\User\User,
* 0: User,
* 1: int,
* 2: int[]
* }>
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/FieldType/BaseFieldTypeTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ abstract public function provideInputForFromHash(): iterable;
* Provides data for the getName() test.
*
* @phpstan-return array<array{
* 0: \Ibexa\Contracts\Core\FieldType\Value,
* 0: FieldTypeValue,
* 1: string,
* 2?: array<string, mixed>,
* 3?: string
Expand Down Expand Up @@ -453,8 +453,8 @@ public function provideValidDataForValidate(): iterable
*
* @phpstan-return iterable<string, array{
* array<string, mixed>,
* \Ibexa\Contracts\Core\FieldType\Value,
* array<\Ibexa\Contracts\Core\FieldType\ValidationError>
* FieldTypeValue,
* array<ValidationError>
* }>
*/
public function provideInvalidDataForValidate(): iterable
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/FieldType/CheckboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Ibexa\Core\Base\Exceptions\InvalidArgumentException;
use Ibexa\Core\FieldType\Checkbox\Type as Checkbox;
use Ibexa\Core\FieldType\Checkbox\Value;
use Ibexa\Core\FieldType\Checkbox\Value as CheckboxValue;

/**
Expand Down Expand Up @@ -151,7 +152,7 @@ public function testValueIsNeverEmpty(CheckboxValue $value): void

/**
* @return iterable<array{
* \Ibexa\Core\FieldType\Checkbox\Value,
* Value,
* }>
*/
public function provideForValueIsNeverEmpty(): iterable
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/FieldType/FieldTypeMockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function testApplyDefaultValidatorConfiguration(

/**
* @return iterable<array{
* null|array<string, mixed>,
* array<string, mixed>|null,
* array<string, mixed>
* }>
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/FieldType/ImageAssetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public function testValidateValidNonEmptyAssetValue(
/**
* @return iterable<array{
* int,
* array<\Ibexa\Core\FieldType\ValidationError>,
* array<ValidationError>,
* }>
*/
public function provideDataForTestValidateValidNonEmptyAssetValue(): iterable
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/FieldType/KeywordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function provideValidDataForValidate(): iterable
/**
* @return iterable<string, array{
* 0: array<string, mixed>,
* 1: \Ibexa\Core\FieldType\Keyword\Value,
* 1: KeywordValue,
* 2: array<\Ibexa\Contracts\Core\FieldType\ValidationError>
* }>
*/
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/MVC/Symfony/Routing/RequestContextFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public function testGetContextBySimplifiedRequest(
* @return iterable<
* string,
* array{
* \Symfony\Component\Routing\RequestContext,
* \Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest,
* \Symfony\Component\Routing\RequestContext
* RequestContext,
* SimplifiedRequest,
* RequestContext
* }>
*/
public static function getDataForTestGetContextBySimplifiedRequest(): iterable
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Repository/NameSchema/NameSchemaServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testResolveUrlAliasSchemaFallbackToNameSchema(): void

/**
* @return iterable<string, array{
* 0: array<int|string, array<string, \Ibexa\Contracts\Core\FieldType\Value>>,
* 0: array<int|string, array<string, Value>>,
* 1: array<string, array<string, string>>,
* 2: array<string>,
* 3: array<string, string>
Expand Down Expand Up @@ -149,7 +149,7 @@ public function testResolveNameSchema(
* @return array<array{
* 0: array<string, array<string>>,
* 1: string,
* 2: array<int|string, array<string, \Ibexa\Contracts\Core\FieldType\Value>>,
* 2: array<int|string, array<string, Value>>,
* 3: array<string, string>,
* 4: array<string, array<string, string>>,
* 5?: array{limit?: int, sequence?: string}
Expand Down
Loading