Skip to content

Commit 1dbc826

Browse files
minor symfony#58064 [Validator] Add @template on CompoundConstraintTestCase (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- [Validator] Add ``@template`` on `CompoundConstraintTestCase` | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | - | License | MIT While writing [the docs](symfony/symfony-docs#20150), I realized ``@template`` could be added. Moreover, it is already present on `ConstraintValidatorTestCase`. Commits ------- 618215a [Validator] Add ``@template`` on CompoundConstraintTestCase`
2 parents 2402a24 + 618215a commit 1dbc826

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Symfony/Component/Validator/Test/CompoundConstraintTestCase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
* A test case to ease testing Compound Constraints.
2828
*
2929
* @author Alexandre Daubois <alex.daubois@gmail.com>
30+
*
31+
* @template T of Compound
3032
*/
3133
abstract class CompoundConstraintTestCase extends TestCase
3234
{
@@ -119,5 +121,8 @@ protected function assertNoViolation(): void
119121
$this->assertSame(0, $violationsCount, \sprintf('No violation expected. Got %d.', $violationsCount));
120122
}
121123

124+
/**
125+
* @return T
126+
*/
122127
abstract protected function createCompound(): Compound;
123128
}

src/Symfony/Component/Validator/Tests/Test/CompoundConstraintTestCaseTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
use Symfony\Component\Validator\Test\CompoundConstraintTestCase;
2020
use Symfony\Component\Validator\Tests\Fixtures\DummyCompoundConstraint;
2121

22+
/**
23+
* @extends CompoundConstraintTestCase<DummyCompoundConstraint>
24+
*/
2225
class CompoundConstraintTestCaseTest extends CompoundConstraintTestCase
2326
{
2427
protected function createCompound(): Compound

0 commit comments

Comments
 (0)