Skip to content

Commit 69d671f

Browse files
committed
Correct CS
1 parent d1ef13d commit 69d671f

File tree

8 files changed

+20
-38
lines changed

8 files changed

+20
-38
lines changed

src/Bundle/DependencyInjection/RollerworksPdbValidatorExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class RollerworksPdbValidatorExtension extends Extension implements Prepen
2424
{
2525
public function load(array $configs, ContainerBuilder $container): void
2626
{
27-
$loader = new Loader\PhpFileLoader($container, new FileLocator(dirname(__DIR__) . '/config'));
27+
$loader = new Loader\PhpFileLoader($container, new FileLocator(\dirname(__DIR__) . '/config'));
2828
$loader->load('services.php');
2929
}
3030

src/Constraint/DomainNameRegistrable.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
/**
1919
* @Annotation
20-
*
2120
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
2221
*/
2322
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
@@ -41,7 +40,7 @@ final class DomainNameRegistrable extends Constraint
4140
*/
4241
public function __construct(
4342
array $options = [],
44-
array $groups = null,
43+
?array $groups = null,
4544
mixed $payload = null,
4645
public bool $allowPrivate = false,
4746
public string $message = 'This value is not a registrable domain name.',

src/Constraint/DomainNameRegistrableValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

2626
final class DomainNameRegistrableValidator extends ConstraintValidator
2727
{
28-
public function __construct(private readonly PdpManager $pdpManager) {}
28+
public function __construct(private readonly PdpManager $pdpManager)
29+
{
30+
}
2931

3032
public function validate(mixed $value, Constraint $constraint): void
3133
{

src/Constraint/DomainNameSuffix.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
/**
1919
* @Annotation
20-
*
2120
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
2221
*/
2322
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
@@ -41,7 +40,7 @@ final class DomainNameSuffix extends Constraint
4140
*/
4241
public function __construct(
4342
array $options = [],
44-
array $groups = null,
43+
?array $groups = null,
4544
mixed $payload = null,
4645
public bool $requireICANN = true,
4746

src/Constraint/DomainNameSuffixValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ final class DomainNameSuffixValidator extends ConstraintValidator
3333
'test',
3434
];
3535

36-
public function __construct(private readonly PdpManager $pdpManager) {}
36+
public function __construct(private readonly PdpManager $pdpManager)
37+
{
38+
}
3739

3840
public function validate(mixed $value, Constraint $constraint): void
3941
{

tests/Constraint/ConstraintViolationComparatorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function assertEquals(mixed $expected, mixed $actual, float $delta = 0.0,
8080
$actual,
8181
$exportedExpected = $exporter->export($expected),
8282
$exportedActual = $exporter->export($actual),
83-
sprintf(
83+
\sprintf(
8484
'Failed asserting that %s matches expected %s.',
8585
$exportedActual,
8686
$exportedExpected

tests/Constraint/DomainNameRegistrableValidatorTest.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ public function it_accepts_domain_names_with_known_suffix(string $name): void
5656
$this->assertNoViolation();
5757
}
5858

59-
/**
60-
* @return \Generator<int, array{0: string}>
61-
*/
59+
/** @return \Generator<int, array{0: string}> */
6260
public static function provideIt_accepts_domain_names_with_known_suffixCases(): iterable
6361
{
6462
yield ['example.com'];
@@ -76,9 +74,7 @@ public function it_accepts_domain_names_with_known_suffix_and_private(string $na
7674
$this->assertNoViolation();
7775
}
7876

79-
/**
80-
* @return \Generator<int, array{0: string}>
81-
*/
77+
/** @return \Generator<int, array{0: string}> */
8278
public static function provideIt_accepts_domain_names_with_known_suffix_and_privateCases(): iterable
8379
{
8480
yield ['example.com'];
@@ -103,9 +99,7 @@ public function it_rejects_domain_names_with_private_suffix(string $name): void
10399
->assertRaised();
104100
}
105101

106-
/**
107-
* @return \Generator<int, array{0: string}>
108-
*/
102+
/** @return \Generator<int, array{0: string}> */
109103
public static function provideIt_rejects_domain_names_with_private_suffixCases(): iterable
110104
{
111105
yield ['example.github.io'];
@@ -133,9 +127,7 @@ public function it_rejects_domain_name_with_path_exceeding_registrable(string $n
133127
->assertRaised();
134128
}
135129

136-
/**
137-
* @return \Generator<int, array{0: string, 1: string}>
138-
*/
130+
/** @return \Generator<int, array{0: string, 1: string}> */
139131
public static function provideIt_rejects_domain_name_with_path_exceeding_registrableCases(): iterable
140132
{
141133
yield ['example.no.co.uk', 'no.co.uk'];
@@ -154,9 +146,7 @@ public function it_rejects_domain_name_when_failed_to_parse(string $name): void
154146
->assertRaised();
155147
}
156148

157-
/**
158-
* @return \Generator<int, array{0: string}>
159-
*/
149+
/** @return \Generator<int, array{0: string}> */
160150
public static function provideIt_rejects_domain_name_when_failed_to_parseCases(): iterable
161151
{
162152
yield ['xn--94823482.nl']; // invalid IDN, which is actually thrown during the resolver phase

tests/Constraint/DomainNameSuffixValidatorTest.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ public function it_accepts_domain_names_with_known_suffix(string $name): void
5656
$this->assertNoViolation();
5757
}
5858

59-
/**
60-
* @return \Generator<int, array{0: string}>
61-
*/
59+
/** @return \Generator<int, array{0: string}> */
6260
public static function provideIt_accepts_domain_names_with_known_suffixCases(): iterable
6361
{
6462
yield ['example.com'];
@@ -78,9 +76,7 @@ public function it_accepts_domain_names_with_known_suffix_and_no_icann_requireme
7876
$this->assertNoViolation();
7977
}
8078

81-
/**
82-
* @return \Generator<int, array{0: string}>
83-
*/
79+
/** @return \Generator<int, array{0: string}> */
8480
public static function provideIt_accepts_domain_names_with_known_suffix_and_no_icann_requirementCases(): iterable
8581
{
8682
yield ['example.com'];
@@ -106,9 +102,7 @@ public function it_rejects_domain_names_with_unknown_suffix(string $name, string
106102
->assertRaised();
107103
}
108104

109-
/**
110-
* @return \Generator<int, array{0: string}|array{0: string, 1: string}>
111-
*/
105+
/** @return \Generator<int, array{0: string}|array{0: string, 1: string}> */
112106
public static function provideRejectedDomainNames(): iterable
113107
{
114108
yield ['example.cong'];
@@ -144,9 +138,7 @@ public function it_rejects_domain_name_when_icann_is_required_but_not_supported_
144138
->assertRaised();
145139
}
146140

147-
/**
148-
* @return \Generator<int, array{0: string}>
149-
*/
141+
/** @return \Generator<int, array{0: string}> */
150142
public static function provideIt_rejects_domain_name_when_icann_is_required_but_not_supported_by_domainCases(): iterable
151143
{
152144
yield ['example.github.io']; // Private suffix-registration.
@@ -163,9 +155,7 @@ public function it_rejects_domain_name_when_failed_to_parse(string $name): void
163155
->assertRaised();
164156
}
165157

166-
/**
167-
* @return \Generator<int, array{0: string}>
168-
*/
158+
/** @return \Generator<int, array{0: string}> */
169159
public static function provideIt_rejects_domain_name_when_failed_to_parseCases(): iterable
170160
{
171161
yield ['xn--94823482.nl']; // invalid IDN, which is actually thrown during the resolver phase

0 commit comments

Comments
 (0)