Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Sep 6, 2024
1 parent ecf91a4 commit 03acf1f
Show file tree
Hide file tree
Showing 41 changed files with 65 additions and 69 deletions.
2 changes: 1 addition & 1 deletion lib/Block/NullBlockDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ public function hasPlugin(string $className): bool

public function getHandler(): BlockDefinitionHandlerInterface
{
return new class() extends BlockDefinitionHandler {};
return new class extends BlockDefinitionHandler {};
}
}
2 changes: 1 addition & 1 deletion lib/Parameters/ParameterBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ function (Options $options, array $value): array {
$resolvedOptions['default_value'],
$resolvedOptions['label'],
$resolvedOptions['groups'],
$resolvedOptions['constraints']
$resolvedOptions['constraints'],
);

return $resolvedOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function testConfigureOptions(): void
public function testConfigureOptionsWithInvalidLayouts(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "layouts" with value array is expected to be of type "Netgen\\Layouts\\API\\Values\\Layout\\LayoutList", but is of type "array".');
$this->expectExceptionMessage('The option "layouts" with value array is expected to be of type "Netgen\Layouts\API\Values\Layout\LayoutList", but is of type "array".');

$optionsResolver = new OptionsResolver();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ public static function getTests(): array
\$nglContext = {$contextNodeGetter};
\$nglTemplate = new {$templateClass}(\$this, \$context, \$blocks);
\$this->env->getRuntime("{$runtimeClass}")->displayZone(\$context["nglayouts"]->getLayout(), \$nglZoneIdentifier, \$nglContext, \$nglTemplate);
EOT
,
EOT,
$environment,
],
[
Expand All @@ -83,8 +82,7 @@ public static function getTests(): array
\$nglContext = {$contextNodeGetter};
\$nglTemplate = new {$templateClass}(\$this, \$context, \$blocks);
\$this->env->getRuntime("{$runtimeClass}")->displayZone(\$context["nglayouts"]->getLayout(), \$nglZoneIdentifier, \$nglContext, \$nglTemplate);
EOT
,
EOT,
$environment,
],
[
Expand All @@ -96,8 +94,7 @@ public static function getTests(): array
\$nglContext = {$viewInterface}::CONTEXT_DEFAULT;
\$nglTemplate = new {$templateClass}(\$this, \$context, \$blocks);
\$this->env->getRuntime("{$runtimeClass}")->displayZone(\$context["nglayouts"]->getLayout(), \$nglZoneIdentifier, \$nglContext, \$nglTemplate);
EOT
,
EOT,
$environment,
],
[
Expand All @@ -109,8 +106,7 @@ public static function getTests(): array
\$nglContext = {$viewInterface}::CONTEXT_DEFAULT;
\$nglTemplate = new {$templateClass}(\$this, \$context, \$blocks);
\$this->env->getRuntime("{$runtimeClass}")->displayZone(\$context["nglayouts"]->getLayout(), \$nglZoneIdentifier, \$nglContext, \$nglTemplate);
EOT
,
EOT,
$environment,
],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testGetCollectionPageUrl(): void
public function testGetCollectionPageUrlThrowsInvalidArgumentExceptionWithInvalidPage(int $page): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessageMatches('/^Argument "page" has an invalid value\\. Page -?\\d+ is out of bounds$/');
$this->expectExceptionMessageMatches('/^Argument "page" has an invalid value\. Page -?\d+ is out of bounds$/');

$pagerfanta = $this->createMock(Pagerfanta::class);
$pagerfanta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ public function testRenderValueThrowsExceptionInDebug(): void
public function testRenderStringTemplate(): void
{
$objectWithoutCast = Block::fromArray(['id' => Uuid::uuid4()]);
$objectWithCast = new class() {
$objectWithCast = new class {
public function __toString(): string
{
return 'foo';
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Block/Form/ContentEditTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function testConfigureOptionsWithMissingBlock(): void
public function testConfigureOptionsWithInvalidBlock(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "block" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Block\\Block", but is of type "string".');
$this->expectExceptionMessage('The option "block" with value "" is expected to be of type "Netgen\Layouts\API\Values\Block\Block", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand All @@ -261,7 +261,7 @@ public function testConfigureOptionsWithInvalidBlock(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Block\\BlockUpdateStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\Block\BlockUpdateStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Block/Form/DesignEditTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function testConfigureOptionsWithMissingBlock(): void
public function testConfigureOptionsWithInvalidBlock(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "block" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Block\\Block", but is of type "string".');
$this->expectExceptionMessage('The option "block" with value "" is expected to be of type "Netgen\Layouts\API\Values\Block\Block", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand All @@ -275,7 +275,7 @@ public function testConfigureOptionsWithInvalidBlock(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Block\\BlockUpdateStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\Block\BlockUpdateStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Block/Form/FullEditTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function testConfigureOptionsWithMissingBlock(): void
public function testConfigureOptionsWithInvalidBlock(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "block" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Block\\Block", but is of type "string".');
$this->expectExceptionMessage('The option "block" with value "" is expected to be of type "Netgen\Layouts\API\Values\Block\Block", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand All @@ -273,7 +273,7 @@ public function testConfigureOptionsWithInvalidBlock(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Block\\BlockUpdateStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\Block\BlockUpdateStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Collection/Form/CollectionEditTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function testConfigureOptionsWithMissingQuery(): void
public function testConfigureOptionsWithInvalidQueryType(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "collection" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Collection\\Collection", but is of type "string".');
$this->expectExceptionMessage('The option "collection" with value "" is expected to be of type "Netgen\Layouts\API\Values\Collection\Collection", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand All @@ -168,7 +168,7 @@ public function testConfigureOptionsWithInvalidQueryType(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Collection\\CollectionUpdateStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\Collection\CollectionUpdateStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Collection/Form/QueryEditTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function testConfigureOptionsWithMissingQuery(): void
public function testConfigureOptionsWithInvalidQueryType(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "query" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Collection\\Query", but is of type "string".');
$this->expectExceptionMessage('The option "query" with value "" is expected to be of type "Netgen\Layouts\API\Values\Collection\Query", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand All @@ -196,7 +196,7 @@ public function testConfigureOptionsWithInvalidQueryType(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Collection\\QueryUpdateStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\Collection\QueryUpdateStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function testRenderWithOverriddenTemplate(): void
public function testRenderThrowsInvalidArgumentExceptionWithNoBlock(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('To render the collection view, "block" option must be an instance of Netgen\\Layouts\\API\\Values\\Block\\Block');
$this->expectExceptionMessage('To render the collection view, "block" option must be an instance of Netgen\Layouts\API\Values\Block\Block');

$pagerMock = $this->createMock(PagerfantaInterface::class);

Expand All @@ -131,7 +131,7 @@ public function testRenderThrowsInvalidArgumentExceptionWithNoBlock(): void
public function testRenderThrowsInvalidArgumentExceptionWithInvalidBlock(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('To render the collection view, "block" option must be an instance of Netgen\\Layouts\\API\\Values\\Block\\Block');
$this->expectExceptionMessage('To render the collection view, "block" option must be an instance of Netgen\Layouts\API\Values\Block\Block');

$pagerMock = $this->createMock(PagerfantaInterface::class);

Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Config/Form/EditTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function testConfigureOptionsWithMissingValue(): void
public function testConfigureOptionsWithInvalidValue(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "configurable" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Config\\ConfigAwareValue", but is of type "string".');
$this->expectExceptionMessage('The option "configurable" with value "" is expected to be of type "Netgen\Layouts\API\Values\Config\ConfigAwareValue", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down Expand Up @@ -286,7 +286,7 @@ public function testConfigureOptionsWithInvalidLabelPrefix(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Config\\ConfigAwareStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\Config\ConfigAwareStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Item/CmsItemBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testBuild(): void
public function testBuildThrowsValueException(): void
{
$this->expectException(ValueException::class);
$this->expectExceptionMessage('Value converter for "Netgen\\Layouts\\Tests\\Item\\Stubs\\Value" type does not exist.');
$this->expectExceptionMessage('Value converter for "Netgen\Layouts\Tests\Item\Stubs\Value" type does not exist.');

/** @var iterable<\Netgen\Layouts\Item\ValueConverterInterface<object>> $valueConverters */
$valueConverters = [new UnsupportedValueConverter()];
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Layout/Form/CopyTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function testConfigureOptionsWithMissingLayout(): void
public function testConfigureOptionsWithInvalidLayout(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "layout" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Layout\\Layout", but is of type "string".');
$this->expectExceptionMessage('The option "layout" with value "" is expected to be of type "Netgen\Layouts\API\Values\Layout\Layout", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand All @@ -126,7 +126,7 @@ public function testConfigureOptionsWithInvalidLayout(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Layout\\LayoutCopyStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\Layout\LayoutCopyStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Layout/Form/CreateTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function testConfigureOptions(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Layout\\LayoutCreateStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\Layout\LayoutCreateStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Layout/Form/EditTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function testConfigureOptionsWithMissingLayout(): void
public function testConfigureOptionsWithInvalidLayout(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "layout" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Layout\\Layout", but is of type "string".');
$this->expectExceptionMessage('The option "layout" with value "" is expected to be of type "Netgen\Layouts\API\Values\Layout\Layout", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand All @@ -127,7 +127,7 @@ public function testConfigureOptionsWithInvalidLayout(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\Layout\\LayoutUpdateStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\Layout\LayoutUpdateStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Layout/Resolver/Form/ConditionTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function testConfigureOptionsWithMissingConditionType(): void
public function testConfigureOptionsWithInvalidConditionType(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "condition_type" with value "" is expected to be of type "Netgen\\Layouts\\Layout\\Resolver\\ConditionTypeInterface", but is of type "string".');
$this->expectExceptionMessage('The option "condition_type" with value "" is expected to be of type "Netgen\Layouts\Layout\Resolver\ConditionTypeInterface", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand All @@ -109,7 +109,7 @@ public function testConfigureOptionsWithInvalidConditionType(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\LayoutResolver\\ConditionStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\LayoutResolver\ConditionStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Layout/Resolver/Form/RuleTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testConfigureOptions(): void
public function testConfigureOptionsWithInvalidData(): void
{
$this->expectException(InvalidOptionsException::class);
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\\Layouts\\API\\Values\\LayoutResolver\\RuleUpdateStruct", but is of type "string".');
$this->expectExceptionMessage('The option "data" with value "" is expected to be of type "Netgen\Layouts\API\Values\LayoutResolver\RuleUpdateStruct", but is of type "string".');

$optionsResolver = new OptionsResolver();
$optionsResolver->setDefined('data');
Expand Down
Loading

0 comments on commit 03acf1f

Please sign in to comment.