Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdbd9096

Browse files
committed
[Validator] add code review fixes
1 parent0fd69b6 commitdbd9096

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

‎reference/constraints/Negative.rst‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,28 @@ Class :class:`Symfony\\Component\\Validator\\Constraints\\Negative`
1414
Validator:class:`Symfony\\Component\\Validator\\Constraints\\LesserThanValidator`
1515
========== ===================================================================
1616

17+
..versionadded::4.3
18+
19+
The ``Negative`` constraint was introduced in Symfony 4.3.
20+
1721
Basic Usage
1822
-----------
1923

20-
The followingconstraints ensure that:
24+
The followingconstraint ensure that:
2125

2226
* the ``withdraw`` of a bankaccount ``TransferItem`` is a negative number (lesser than zero)
2327

2428
..configuration-block::
2529

2630
..code-block::php-annotations
2731
28-
// src/Entity/Freezer.php
32+
// src/Entity/TransferItem.php
2933
namespace App\Entity;
3034
3135
use Symfony\Component\Validator\Constraints as Assert;
3236
3337
class TransferItem
3438
{
35-
3639
/**
3740
* @Assert\Negative
3841
*/
@@ -74,6 +77,6 @@ The following constraints ensure that:
7477
{
7578
public static function loadValidatorMetadata(ClassMetadata $metadata)
7679
{
77-
$metadata->addPropertyConstraint('withdraw', new Assert\Negative;
80+
$metadata->addPropertyConstraint('withdraw', new Assert\Negative();
7881
}
7982
}

‎reference/constraints/Positive.rst‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ Class :class:`Symfony\\Component\\Validator\\Constraints\\Positive`
1414
Validator:class:`Symfony\\Component\\Validator\\Constraints\\GreaterThanValidator`
1515
========== ===================================================================
1616

17+
..versionadded::4.3
18+
19+
The ``Positive`` constraint was introduced in Symfony 4.3.
20+
1721
Basic Usage
1822
-----------
1923

20-
The followingconstraints ensure that:
24+
The followingconstraint ensure that:
2125

2226
* the ``income`` of an ``Employee`` is a positive number (greater than zero)
2327

@@ -32,7 +36,6 @@ The following constraints ensure that:
3236
3337
class Employee
3438
{
35-
3639
/**
3740
* @Assert\Positive
3841
*/
@@ -74,6 +77,6 @@ The following constraints ensure that:
7477
{
7578
public static function loadValidatorMetadata(ClassMetadata $metadata)
7679
{
77-
$metadata->addPropertyConstraint('income', new Assert\Positive;
80+
$metadata->addPropertyConstraint('income', new Assert\Positive();
7881
}
7982
}

‎reference/constraints/PositiveOrZero.rst‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ Class :class:`Symfony\\Component\\Validator\\Constraints\\PositiveOrZero`
1515
Validator:class:`Symfony\\Component\\Validator\\Constraints\\GreaterThanOrEqualValidator`
1616
========== ===================================================================
1717

18+
..versionadded::4.3
19+
20+
The ``PositiveOrZero`` constraint was introduced in Symfony 4.3.
21+
1822
Basic Usage
1923
-----------
2024

21-
The followingconstraints ensure that:
25+
The followingconstraint ensure that:
2226

2327
* the number of ``siblings`` of a ``Person`` is positive or zero
2428

@@ -74,6 +78,6 @@ The following constraints ensure that:
7478
{
7579
public static function loadValidatorMetadata(ClassMetadata $metadata)
7680
{
77-
$metadata->addPropertyConstraint('siblings', new Assert\PositiveOrZero);
81+
$metadata->addPropertyConstraint('siblings', new Assert\PositiveOrZero();
7882
}
7983
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp