10000 last improvements · symfony/symfony@91da8a7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 91da8a7

Browse files
committed
last improvements
1 parent 4851495 commit 91da8a7

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/Symfony/Component/Validator/Constraints/GroupSequenceProvider.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,25 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14+
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
15+
use Symfony\Component\Validator\Attribute\HasNamedArguments;
16+
1417
/**
1518
* Attribute to define a group sequence provider.
1619
*
1720
* @Annotation
1821
*
22+
* @NamedArgumentConstructor
23+
*
1924
* @Target({"CLASS", "ANNOTATION"})
2025
*
2126
* @author Bernhard Schussek <bschussek@gmail.com>
2227
*/
2328
#[\Attribute(\Attribute::TARGET_CLASS)]
2429
class GroupSequenceProvider
2530
{
26-
public ?string $provider = null;
27-
28-
public function __construct(array $options = [], string $provider = null)
31+
#[HasNamedArguments]
32+
public function __construct(public ?string $provider = null)
2933
{
30-
$this->provider = $options['provider'] ?? $provider;
3134
}
3235
}

src/Symfony/Component/Validator/Tests/Constraints/GroupSequenceProviderTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@
1717

1818
class GroupSequenceProviderTest extends TestCase
1919
{
20-
public function testCreate()
21-
{
22-
$sequence = new GroupSequenceProvider(['provider' => DummyGroupProvider::class]);
23-
24-
$this->assertSame(DummyGroupProvider::class, $sequence->provider);
25-
}
26-
2720
public function testCreateAttributeStyle()
2821
{
2922
$sequence = new GroupSequenceProvider(provider: DummyGroupProvider::class);

0 commit comments

Comments
 (0)
0