diff --git a/.github/workflows/coding_standards.yml b/.github/workflows/coding_standards.yml index 0e161330..f943db45 100644 --- a/.github/workflows/coding_standards.yml +++ b/.github/workflows/coding_standards.yml @@ -18,6 +18,6 @@ jobs: with: repository: netgen-layouts/layouts-coding-standard path: vendor/netgen/layouts-coding-standard - - uses: OskarStark/php-cs-fixer-ga@master + - uses: docker://oskarstark/php-cs-fixer-ga with: args: --diff --dry-run diff --git a/bundle/Controller/Admin/DeleteRule.php b/bundle/Controller/Admin/DeleteRule.php index f9afcce3..c063f13d 100644 --- a/bundle/Controller/Admin/DeleteRule.php +++ b/bundle/Controller/Admin/DeleteRule.php @@ -43,7 +43,5 @@ public function __invoke(Rule $rule, Request $request): Response return new Response('', Response::HTTP_NO_CONTENT); } - public function checkPermissions(): void - { - } + public function checkPermissions(): void {} } diff --git a/composer.json b/composer.json index 9f1ea2e6..60afbabe 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": "^8.1", - "netgen/layouts-core": "~1.4.5", + "netgen/layouts-core": "~1.4.6", "netgen/content-browser-ibexa": "^1.4", "ibexa/core": "^4.4", "ibexa/admin-ui": "^4.4", diff --git a/phpstan.tests.neon b/phpstan.tests.neon index 5d4c5553..47a9210a 100644 --- a/phpstan.tests.neon +++ b/phpstan.tests.neon @@ -10,7 +10,7 @@ parameters: - '#Unreachable statement - code above always terminates.#' # Disable errors about missing value types in PHPUnit data providers - - '#Method .+Test(Base)?::\w+DataProvider\(\) return type has no value type specified in iterable type array.#' + - '#Method .+Test(Base)?::\w+DataProvider\(\) return type has no value type specified in iterable type iterable.#' # Disable errors for various tests that verify the instance of the value - '#Call to static method PHPUnit\\Framework\\Assert::assertInstanceOf\(\)#' diff --git a/tests/bundle/DependencyInjection/CompilerPass/HttpCache/ConfigureHttpCachePassTest.php b/tests/bundle/DependencyInjection/CompilerPass/HttpCache/ConfigureHttpCachePassTest.php index 4ea80301..4f6d79bc 100644 --- a/tests/bundle/DependencyInjection/CompilerPass/HttpCache/ConfigureHttpCachePassTest.php +++ b/tests/bundle/DependencyInjection/CompilerPass/HttpCache/ConfigureHttpCachePassTest.php @@ -51,7 +51,7 @@ public function testProcessWithNoSupportedClient(): void $this->assertContainerBuilderNotHasAlias('netgen_layouts.http_cache.client'); } - public static function processDataProvider(): array + public static function processDataProvider(): iterable { return [ [VarnishPurgeClient::class, true], diff --git a/tests/lib/Block/BlockDefinition/Integration/ComponentTestBase.php b/tests/lib/Block/BlockDefinition/Integration/ComponentTestBase.php index 96715330..f58ca58c 100644 --- a/tests/lib/Block/BlockDefinition/Integration/ComponentTestBase.php +++ b/tests/lib/Block/BlockDefinition/Integration/ComponentTestBase.php @@ -19,7 +19,7 @@ abstract class ComponentTestBase extends BlockTestCase { - public static function parametersDataProvider(): array + public static function parametersDataProvider(): iterable { return [ [ @@ -60,7 +60,7 @@ public static function parametersDataProvider(): array ]; } - public static function invalidParametersDataProvider(): array + public static function invalidParametersDataProvider(): iterable { return [ [ diff --git a/tests/lib/Block/BlockDefinition/Integration/ContentFieldTestBase.php b/tests/lib/Block/BlockDefinition/Integration/ContentFieldTestBase.php index 524f105e..922385f5 100644 --- a/tests/lib/Block/BlockDefinition/Integration/ContentFieldTestBase.php +++ b/tests/lib/Block/BlockDefinition/Integration/ContentFieldTestBase.php @@ -11,7 +11,7 @@ abstract class ContentFieldTestBase extends BlockTestCase { - public static function parametersDataProvider(): array + public static function parametersDataProvider(): iterable { return [ [ @@ -53,7 +53,7 @@ public static function parametersDataProvider(): array ]; } - public static function invalidParametersDataProvider(): array + public static function invalidParametersDataProvider(): iterable { return [ [ diff --git a/tests/lib/Layout/Resolver/ConditionType/ContentTypeTest.php b/tests/lib/Layout/Resolver/ConditionType/ContentTypeTest.php index 384ad030..254a5f4a 100644 --- a/tests/lib/Layout/Resolver/ConditionType/ContentTypeTest.php +++ b/tests/lib/Layout/Resolver/ConditionType/ContentTypeTest.php @@ -124,7 +124,7 @@ public function testMatchesWithNoContent(): void self::assertFalse($this->conditionType->matches($request, ['article'])); } - public static function matchesDataProvider(): array + public static function matchesDataProvider(): iterable { return [ ['not_array', false], diff --git a/tests/lib/Layout/Resolver/ConditionType/SiteAccessGroupTest.php b/tests/lib/Layout/Resolver/ConditionType/SiteAccessGroupTest.php index e4a96255..18de62e2 100644 --- a/tests/lib/Layout/Resolver/ConditionType/SiteAccessGroupTest.php +++ b/tests/lib/Layout/Resolver/ConditionType/SiteAccessGroupTest.php @@ -76,7 +76,7 @@ public function testMatchesWithNoSiteAccess(): void /** * Provider for testing condition type validation. */ - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ [['frontend'], true], @@ -88,7 +88,7 @@ public static function validationDataProvider(): array ]; } - public static function matchesDataProvider(): array + public static function matchesDataProvider(): iterable { return [ ['not_array', false], diff --git a/tests/lib/Layout/Resolver/ConditionType/SiteAccessTest.php b/tests/lib/Layout/Resolver/ConditionType/SiteAccessTest.php index 623fc7d5..9ce6f6dd 100644 --- a/tests/lib/Layout/Resolver/ConditionType/SiteAccessTest.php +++ b/tests/lib/Layout/Resolver/ConditionType/SiteAccessTest.php @@ -59,7 +59,7 @@ public function testMatchesWithNoSiteAccess(): void /** * Provider for testing condition type validation. */ - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ [['cro'], true], @@ -71,7 +71,7 @@ public static function validationDataProvider(): array ]; } - public static function matchesDataProvider(): array + public static function matchesDataProvider(): iterable { return [ ['not_array', false], diff --git a/tests/lib/Layout/Resolver/TargetType/SemanticPathInfoPrefixTest.php b/tests/lib/Layout/Resolver/TargetType/SemanticPathInfoPrefixTest.php index 60cd8701..746281ed 100644 --- a/tests/lib/Layout/Resolver/TargetType/SemanticPathInfoPrefixTest.php +++ b/tests/lib/Layout/Resolver/TargetType/SemanticPathInfoPrefixTest.php @@ -67,7 +67,7 @@ public function testProvideValueWithNoSemanticPathInfo(): void /** * Provider for testing target type validation. */ - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ ['/some/route', true], diff --git a/tests/lib/Layout/Resolver/TargetType/SemanticPathInfoTest.php b/tests/lib/Layout/Resolver/TargetType/SemanticPathInfoTest.php index 6b315ff4..01aa2f8f 100644 --- a/tests/lib/Layout/Resolver/TargetType/SemanticPathInfoTest.php +++ b/tests/lib/Layout/Resolver/TargetType/SemanticPathInfoTest.php @@ -67,7 +67,7 @@ public function testProvideValueWithNoSemanticPathInfo(): void /** * Provider for testing target type validation. */ - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ ['/some/route', true], diff --git a/tests/lib/Parameters/ParameterType/ContentTypeTest.php b/tests/lib/Parameters/ParameterType/ContentTypeTest.php index 9fc8b136..cc1d5fba 100644 --- a/tests/lib/Parameters/ParameterType/ContentTypeTest.php +++ b/tests/lib/Parameters/ParameterType/ContentTypeTest.php @@ -104,7 +104,7 @@ public function testInvalidOptions(array $options): void /** * Provider for testing valid parameter attributes. */ - public static function validOptionsDataProvider(): array + public static function validOptionsDataProvider(): iterable { return [ [ @@ -156,7 +156,7 @@ public static function validOptionsDataProvider(): array /** * Provider for testing invalid parameter attributes. */ - public static function invalidOptionsDataProvider(): array + public static function invalidOptionsDataProvider(): iterable { return [ [ @@ -257,7 +257,7 @@ public function testValidation(mixed $value, int $type, bool $required, bool $is /** * Provider for testing valid parameter values. */ - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ [12, 24, false, true], @@ -291,7 +291,7 @@ public function testFromHash(mixed $value, mixed $convertedValue): void ); } - public static function fromHashDataProvider(): array + public static function fromHashDataProvider(): iterable { return [ [ @@ -318,7 +318,7 @@ public function testIsValueEmpty(mixed $value, bool $isEmpty): void /** * Provider for testing if the value is empty. */ - public static function emptyDataProvider(): array + public static function emptyDataProvider(): iterable { return [ [null, true], diff --git a/tests/lib/Parameters/ParameterType/ContentTypeTypeTest.php b/tests/lib/Parameters/ParameterType/ContentTypeTypeTest.php index 760ce465..09455e9a 100644 --- a/tests/lib/Parameters/ParameterType/ContentTypeTypeTest.php +++ b/tests/lib/Parameters/ParameterType/ContentTypeTypeTest.php @@ -79,7 +79,7 @@ public function testInvalidOptions(array $options): void /** * Provider for testing valid parameter attributes. */ - public static function validOptionsDataProvider(): array + public static function validOptionsDataProvider(): iterable { return [ [ @@ -131,7 +131,7 @@ public static function validOptionsDataProvider(): array /** * Provider for testing invalid parameter attributes. */ - public static function invalidOptionsDataProvider(): array + public static function invalidOptionsDataProvider(): iterable { return [ [ @@ -175,7 +175,7 @@ public function testValidation(mixed $value, bool $required, bool $isValid): voi /** * Provider for testing valid parameter values. */ - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ ['news', false, true], @@ -211,7 +211,7 @@ public function testFromHash(mixed $value, mixed $convertedValue, bool $multiple ); } - public static function fromHashDataProvider(): array + public static function fromHashDataProvider(): iterable { return [ [ @@ -266,7 +266,7 @@ public function testIsValueEmpty(mixed $value, bool $isEmpty): void /** * Provider for testing if the value is empty. */ - public static function emptyDataProvider(): array + public static function emptyDataProvider(): iterable { return [ [null, true], diff --git a/tests/lib/Parameters/ParameterType/LocationTypeTest.php b/tests/lib/Parameters/ParameterType/LocationTypeTest.php index e535c971..01acec28 100644 --- a/tests/lib/Parameters/ParameterType/LocationTypeTest.php +++ b/tests/lib/Parameters/ParameterType/LocationTypeTest.php @@ -86,7 +86,7 @@ public function testInvalidOptions(array $options): void /** * Provider for testing valid parameter attributes. */ - public static function validOptionsDataProvider(): array + public static function validOptionsDataProvider(): iterable { return [ [ @@ -138,7 +138,7 @@ public static function validOptionsDataProvider(): array /** * Provider for testing invalid parameter attributes. */ - public static function invalidOptionsDataProvider(): array + public static function invalidOptionsDataProvider(): iterable { return [ [ @@ -248,7 +248,7 @@ public function testValidation(mixed $value, string $type, bool $required, bool /** * Provider for testing valid parameter values. */ - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ [12, 'user', false, true], @@ -282,7 +282,7 @@ public function testFromHash(mixed $value, mixed $convertedValue): void ); } - public static function fromHashDataProvider(): array + public static function fromHashDataProvider(): iterable { return [ [ @@ -309,7 +309,7 @@ public function testIsValueEmpty(mixed $value, bool $isEmpty): void /** * Provider for testing if the value is empty. */ - public static function emptyDataProvider(): array + public static function emptyDataProvider(): iterable { return [ [null, true], diff --git a/tests/lib/Parameters/ParameterType/ObjectStateTypeTest.php b/tests/lib/Parameters/ParameterType/ObjectStateTypeTest.php index d2f80c7f..5a8a1a95 100644 --- a/tests/lib/Parameters/ParameterType/ObjectStateTypeTest.php +++ b/tests/lib/Parameters/ParameterType/ObjectStateTypeTest.php @@ -79,7 +79,7 @@ public function testInvalidOptions(array $options): void /** * Provider for testing valid parameter attributes. */ - public static function validOptionsDataProvider(): array + public static function validOptionsDataProvider(): iterable { return [ [ @@ -131,7 +131,7 @@ public static function validOptionsDataProvider(): array /** * Provider for testing invalid parameter attributes. */ - public static function invalidOptionsDataProvider(): array + public static function invalidOptionsDataProvider(): iterable { return [ [ @@ -214,7 +214,7 @@ public function testValidationWithEmptyValues(mixed $value, bool $required, bool self::assertSame($isValid, $errors->count() === 0); } - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ ['group1|state2', false, true], @@ -234,7 +234,7 @@ public static function validationDataProvider(): array ]; } - public static function validationWithEmptyValuesDataProvider(): array + public static function validationWithEmptyValuesDataProvider(): iterable { return [ [[], false, true], @@ -260,7 +260,7 @@ public function testFromHash(mixed $value, mixed $convertedValue, bool $multiple ); } - public static function fromHashDataProvider(): array + public static function fromHashDataProvider(): iterable { return [ [ @@ -315,7 +315,7 @@ public function testIsValueEmpty(mixed $value, bool $isEmpty): void /** * Provider for testing if the value is empty. */ - public static function emptyDataProvider(): array + public static function emptyDataProvider(): iterable { return [ [null, true], diff --git a/tests/lib/Parameters/ParameterType/SectionTypeTest.php b/tests/lib/Parameters/ParameterType/SectionTypeTest.php index f35ba82a..3a6c2330 100644 --- a/tests/lib/Parameters/ParameterType/SectionTypeTest.php +++ b/tests/lib/Parameters/ParameterType/SectionTypeTest.php @@ -79,7 +79,7 @@ public function testInvalidOptions(array $options): void /** * Provider for testing valid parameter attributes. */ - public static function validOptionsDataProvider(): array + public static function validOptionsDataProvider(): iterable { return [ [ @@ -131,7 +131,7 @@ public static function validOptionsDataProvider(): array /** * Provider for testing invalid parameter attributes. */ - public static function invalidOptionsDataProvider(): array + public static function invalidOptionsDataProvider(): iterable { return [ [ @@ -181,7 +181,7 @@ public function testValidation(mixed $value, bool $required, bool $isValid): voi /** * Provider for testing valid parameter values. */ - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ ['standard', false, true], @@ -217,7 +217,7 @@ public function testFromHash(mixed $value, mixed $convertedValue, bool $multiple ); } - public static function fromHashDataProvider(): array + public static function fromHashDataProvider(): iterable { return [ [ @@ -272,7 +272,7 @@ public function testIsValueEmpty(mixed $value, bool $isEmpty): void /** * Provider for testing if the value is empty. */ - public static function emptyDataProvider(): array + public static function emptyDataProvider(): iterable { return [ [null, true], diff --git a/tests/lib/Parameters/ParameterType/TagsTypeTest.php b/tests/lib/Parameters/ParameterType/TagsTypeTest.php index 0e577235..c4c3badd 100644 --- a/tests/lib/Parameters/ParameterType/TagsTypeTest.php +++ b/tests/lib/Parameters/ParameterType/TagsTypeTest.php @@ -61,7 +61,7 @@ public function testInvalidOptions(array $options): void /** * Provider for testing valid parameter attributes. */ - public static function validOptionsDataProvider(): array + public static function validOptionsDataProvider(): iterable { return [ [ @@ -162,7 +162,7 @@ public static function validOptionsDataProvider(): array /** * Provider for testing invalid parameter attributes. */ - public static function invalidOptionsDataProvider(): array + public static function invalidOptionsDataProvider(): iterable { return [ [ @@ -215,7 +215,7 @@ public function testFromHash(mixed $value, mixed $convertedValue): void ); } - public static function fromHashDataProvider(): array + public static function fromHashDataProvider(): iterable { return [ [ @@ -296,7 +296,7 @@ public function testValidation(mixed $values, bool $required, bool $isValid): vo self::assertSame($isValid, $errors->count() === 0); } - public static function validationDataProvider(): array + public static function validationDataProvider(): iterable { return [ [[12], false, true], diff --git a/tests/lib/Security/Authorization/Voter/RepositoryAccessVoterTest.php b/tests/lib/Security/Authorization/Voter/RepositoryAccessVoterTest.php index 2c3b0f83..b415e5be 100644 --- a/tests/lib/Security/Authorization/Voter/RepositoryAccessVoterTest.php +++ b/tests/lib/Security/Authorization/Voter/RepositoryAccessVoterTest.php @@ -67,7 +67,7 @@ public function testVote(mixed $attribute, array $repoAccess, int $voteResult): self::assertSame($voteResult, $result); } - public static function voteDataProvider(): array + public static function voteDataProvider(): iterable { return [ // Only matches admin Ibexa function diff --git a/tests/lib/Security/Role/RoleHierarchyTest.php b/tests/lib/Security/Role/RoleHierarchyTest.php index 4691c538..b2bc6535 100644 --- a/tests/lib/Security/Role/RoleHierarchyTest.php +++ b/tests/lib/Security/Role/RoleHierarchyTest.php @@ -40,7 +40,7 @@ public function testGetReachableRoleNames(string $startingRole, array $expectedR } } - public static function getReachableRolesDataProvider(): array + public static function getReachableRolesDataProvider(): iterable { return [ [ diff --git a/tests/lib/Validator/ContentTypeValidatorTest.php b/tests/lib/Validator/ContentTypeValidatorTest.php index d804bfb6..a2593d32 100644 --- a/tests/lib/Validator/ContentTypeValidatorTest.php +++ b/tests/lib/Validator/ContentTypeValidatorTest.php @@ -103,7 +103,7 @@ public function testValidateThrowsUnexpectedTypeExceptionWithInvalidValue(): voi $this->assertValid(true, 42); } - public static function validateDataProvider(): array + public static function validateDataProvider(): iterable { return [ ['article', ['group1'], [], true], diff --git a/tests/lib/Validator/ObjectStateValidatorTest.php b/tests/lib/Validator/ObjectStateValidatorTest.php index 9b490011..f2390f81 100644 --- a/tests/lib/Validator/ObjectStateValidatorTest.php +++ b/tests/lib/Validator/ObjectStateValidatorTest.php @@ -126,7 +126,7 @@ public function testValidateThrowsUnexpectedTypeExceptionWithInvalidValueFormat( $this->assertValid(true, 'state'); } - public static function validateDataProvider(): array + public static function validateDataProvider(): iterable { return [ ['group1|state1', [], true], diff --git a/tests/lib/Validator/SectionValidatorTest.php b/tests/lib/Validator/SectionValidatorTest.php index 40ef3c78..726c0ed1 100644 --- a/tests/lib/Validator/SectionValidatorTest.php +++ b/tests/lib/Validator/SectionValidatorTest.php @@ -91,7 +91,7 @@ public function testValidateThrowsUnexpectedTypeExceptionWithInvalidValue(): voi $this->assertValid(true, 42); } - public static function validateDataProvider(): array + public static function validateDataProvider(): iterable { return [ ['media', [], true], diff --git a/tests/lib/Validator/SiteAccessGroupValidatorTest.php b/tests/lib/Validator/SiteAccessGroupValidatorTest.php index 168ebd65..12ba1f2d 100644 --- a/tests/lib/Validator/SiteAccessGroupValidatorTest.php +++ b/tests/lib/Validator/SiteAccessGroupValidatorTest.php @@ -46,7 +46,7 @@ public function testValidateThrowsUnexpectedTypeExceptionWithInvalidValue(): voi $this->assertValid(true, 42); } - public static function validateDataProvider(): array + public static function validateDataProvider(): iterable { return [ ['frontend', true], diff --git a/tests/lib/Validator/SiteAccessValidatorTest.php b/tests/lib/Validator/SiteAccessValidatorTest.php index 5eb0375b..f2fe952c 100644 --- a/tests/lib/Validator/SiteAccessValidatorTest.php +++ b/tests/lib/Validator/SiteAccessValidatorTest.php @@ -46,7 +46,7 @@ public function testValidateThrowsUnexpectedTypeExceptionWithInvalidValue(): voi $this->assertValid(true, 42); } - public static function validateDataProvider(): array + public static function validateDataProvider(): iterable { return [ ['eng', true],