Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Sep 12, 2023
1 parent 50ab59b commit 63b96ec
Show file tree
Hide file tree
Showing 23 changed files with 51 additions and 53 deletions.
4 changes: 1 addition & 3 deletions bundle/Controller/Admin/DeleteRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ public function __invoke(Rule $rule, Request $request): Response
return new Response('', Response::HTTP_NO_CONTENT);
}

public function checkPermissions(): void
{
}
public function checkPermissions(): void {}
}
2 changes: 1 addition & 1 deletion phpstan.tests.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ parameters:
- '#Call to an undefined method Netgen\\Layouts\\Ez\\Security\\Role\\RoleHierarchy::getReachableRoles\(\).#'

# 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\(\)#'
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

abstract class ComponentTestBase extends BlockTestCase
{
public static function parametersDataProvider(): array
public static function parametersDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -60,7 +60,7 @@ public static function parametersDataProvider(): array
];
}

public static function invalidParametersDataProvider(): array
public static function invalidParametersDataProvider(): iterable
{
return [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

abstract class ContentFieldTestBase extends BlockTestCase
{
public static function parametersDataProvider(): array
public static function parametersDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -53,7 +53,7 @@ public static function parametersDataProvider(): array
];
}

public static function invalidParametersDataProvider(): array
public static function invalidParametersDataProvider(): iterable
{
return [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function testMatchesWithNoSiteAccess(): void
/**
* Provider for testing condition type validation.
*/
public static function validationDataProvider(): array
public static function validationDataProvider(): iterable
{
return [
[['frontend'], true],
Expand All @@ -107,7 +107,7 @@ public static function validationDataProvider(): array
];
}

public static function matchesDataProvider(): array
public static function matchesDataProvider(): iterable
{
return [
['not_array', false],
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Layout/Resolver/ConditionType/SiteAccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testMatchesWithNoSiteAccess(): void
/**
* Provider for testing condition type validation.
*/
public static function validationDataProvider(): array
public static function validationDataProvider(): iterable
{
return [
[['cro'], true],
Expand All @@ -86,7 +86,7 @@ public static function validationDataProvider(): array
];
}

public static function matchesDataProvider(): array
public static function matchesDataProvider(): iterable
{
return [
['not_array', false],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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],
Expand Down
10 changes: 5 additions & 5 deletions tests/lib/Parameters/ParameterType/ContentTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function testInvalidOptions(array $options): void
/**
* Provider for testing valid parameter attributes.
*/
public static function validOptionsDataProvider(): array
public static function validOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -172,7 +172,7 @@ public static function validOptionsDataProvider(): array
/**
* Provider for testing invalid parameter attributes.
*/
public static function invalidOptionsDataProvider(): array
public static function invalidOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -294,7 +294,7 @@ static function () use ($value, $type): ContentInfo {
/**
* Provider for testing valid parameter values.
*/
public static function validationDataProvider(): array
public static function validationDataProvider(): iterable
{
return [
[12, 24, false, true],
Expand Down Expand Up @@ -335,7 +335,7 @@ public function testFromHash($value, $convertedValue): void
);
}

public static function fromHashDataProvider(): array
public static function fromHashDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -368,7 +368,7 @@ public function testIsValueEmpty($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],
Expand Down
10 changes: 5 additions & 5 deletions tests/lib/Parameters/ParameterType/ContentTypeTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function testInvalidOptions(array $options): void
/**
* Provider for testing valid parameter attributes.
*/
public static function validOptionsDataProvider(): array
public static function validOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -140,7 +140,7 @@ public static function validOptionsDataProvider(): array
/**
* Provider for testing invalid parameter attributes.
*/
public static function invalidOptionsDataProvider(): array
public static function invalidOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -193,7 +193,7 @@ static function (string $identifier): EzContentType {
/**
* Provider for testing valid parameter values.
*/
public static function validationDataProvider(): array
public static function validationDataProvider(): iterable
{
return [
['news', false, true],
Expand Down Expand Up @@ -236,7 +236,7 @@ public function testFromHash($value, $convertedValue, bool $multiple): void
);
}

public static function fromHashDataProvider(): array
public static function fromHashDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -297,7 +297,7 @@ public function testIsValueEmpty($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],
Expand Down
10 changes: 5 additions & 5 deletions tests/lib/Parameters/ParameterType/LocationTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testInvalidOptions(array $options): void
/**
* Provider for testing valid parameter attributes.
*/
public static function validOptionsDataProvider(): array
public static function validOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -148,7 +148,7 @@ public static function validOptionsDataProvider(): array
/**
* Provider for testing invalid parameter attributes.
*/
public static function invalidOptionsDataProvider(): array
public static function invalidOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -279,7 +279,7 @@ static function () use ($value, $type): Location {
/**
* Provider for testing valid parameter values.
*/
public static function validationDataProvider(): array
public static function validationDataProvider(): iterable
{
return [
[12, 'user', false, true],
Expand Down Expand Up @@ -320,7 +320,7 @@ public function testFromHash($value, $convertedValue): void
);
}

public static function fromHashDataProvider(): array
public static function fromHashDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -353,7 +353,7 @@ public function testIsValueEmpty($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],
Expand Down
12 changes: 6 additions & 6 deletions tests/lib/Parameters/ParameterType/ObjectStateTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function testInvalidOptions(array $options): void
/**
* Provider for testing valid parameter attributes.
*/
public static function validOptionsDataProvider(): array
public static function validOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -140,7 +140,7 @@ public static function validOptionsDataProvider(): array
/**
* Provider for testing invalid parameter attributes.
*/
public static function invalidOptionsDataProvider(): array
public static function invalidOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -235,7 +235,7 @@ public function testValidationWithEmptyValues($value, bool $required, bool $isVa
self::assertSame($isValid, $errors->count() === 0);
}

public static function validationDataProvider(): array
public static function validationDataProvider(): iterable
{
return [
['group1|state2', false, true],
Expand All @@ -255,7 +255,7 @@ public static function validationDataProvider(): array
];
}

public static function validationWithEmptyValuesDataProvider(): array
public static function validationWithEmptyValuesDataProvider(): iterable
{
return [
[[], false, true],
Expand Down Expand Up @@ -288,7 +288,7 @@ public function testFromHash($value, $convertedValue, bool $multiple): void
);
}

public static function fromHashDataProvider(): array
public static function fromHashDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -349,7 +349,7 @@ public function testIsValueEmpty($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],
Expand Down
10 changes: 5 additions & 5 deletions tests/lib/Parameters/ParameterType/SectionTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function testInvalidOptions(array $options): void
/**
* Provider for testing valid parameter attributes.
*/
public static function validOptionsDataProvider(): array
public static function validOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -140,7 +140,7 @@ public static function validOptionsDataProvider(): array
/**
* Provider for testing invalid parameter attributes.
*/
public static function invalidOptionsDataProvider(): array
public static function invalidOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -199,7 +199,7 @@ static function (string $identifier): EzSection {
/**
* Provider for testing valid parameter values.
*/
public static function validationDataProvider(): array
public static function validationDataProvider(): iterable
{
return [
['standard', false, true],
Expand Down Expand Up @@ -242,7 +242,7 @@ public function testFromHash($value, $convertedValue, bool $multiple): void
);
}

public static function fromHashDataProvider(): array
public static function fromHashDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -303,7 +303,7 @@ public function testIsValueEmpty($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],
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/Parameters/ParameterType/TagsTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testInvalidOptions(array $options): void
/**
* Provider for testing valid parameter attributes.
*/
public static function validOptionsDataProvider(): array
public static function validOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -174,7 +174,7 @@ public static function validOptionsDataProvider(): array
/**
* Provider for testing invalid parameter attributes.
*/
public static function invalidOptionsDataProvider(): array
public static function invalidOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -234,7 +234,7 @@ public function testFromHash($value, $convertedValue): void
);
}

public static function fromHashDataProvider(): array
public static function fromHashDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -354,7 +354,7 @@ static function (int $id): Tag {
self::assertSame($isValid, $errors->count() === 0);
}

public static function validationDataProvider(): array
public static function validationDataProvider(): iterable
{
return [
[[12], false, true],
Expand Down
Loading

0 comments on commit 63b96ec

Please sign in to comment.