Skip to content

Commit f54067b

Browse files
committed
minor symfony#10676 Removed useless parentheses in Assert annotations (thomasbisignani)
This PR was merged into the 2.8 branch. Discussion ---------- Removed useless parentheses in Assert annotations To be consistent, this PR removes the useless empty parentheses in the `@Assert` annotations for constraints. Sometimes `@Assert` annotations for constraints without options were used with empty parentheses, sometimes without parentheses. Commits ------- f5980f0 Removed useless parentheses in Assert annotations
2 parents a6d7053 + f5980f0 commit f54067b

21 files changed

+27
-27
lines changed

best_practices/forms.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ blank, add the following in the ``Post`` object::
169169
class Post
170170
{
171171
/**
172-
* @Assert\NotBlank()
172+
* @Assert\NotBlank
173173
*/
174174
public $title;
175175
}

components/validator/resources.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ prefixed classes included in doc block comments (``/** ... */``). For example::
100100
class User
101101
{
102102
/**
103-
* @Assert\NotBlank()
103+
* @Assert\NotBlank
104104
*/
105105
protected $name;
106106
}

doctrine/registration_form.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ With some validation added, your class may look something like this::
6363

6464
/**
6565
* @ORM\Column(type="string", length=255, unique=true)
66-
* @Assert\NotBlank()
67-
* @Assert\Email()
66+
* @Assert\NotBlank
67+
* @Assert\Email
6868
*/
6969
private $email;
7070

7171
/**
7272
* @ORM\Column(type="string", length=255, unique=true)
73-
* @Assert\NotBlank()
73+
* @Assert\NotBlank
7474
*/
7575
private $username;
7676

7777
/**
78-
* @Assert\NotBlank()
78+
* @Assert\NotBlank
7979
* @Assert\Length(max=4096)
8080
*/
8181
private $plainPassword;

form/embedded.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ of course, by creating the ``Category`` object::
2525
class Category
2626
{
2727
/**
28-
* @Assert\NotBlank()
28+
* @Assert\NotBlank
2929
*/
3030
public $name;
3131
}
@@ -40,7 +40,7 @@ Next, add a new ``category`` property to the ``Task`` class::
4040

4141
/**
4242
* @Assert\Type(type="AppBundle\Entity\Category")
43-
* @Assert\Valid()
43+
* @Assert\Valid
4444
*/
4545
protected $category;
4646

forms.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ object.
334334
class Task
335335
{
336336
/**
337-
* @Assert\NotBlank()
337+
* @Assert\NotBlank
338338
*/
339339
public $task;
340340
341341
/**
342-
* @Assert\NotBlank()
342+
* @Assert\NotBlank
343343
* @Assert\Type("\DateTime")
344344
*/
345345
protected $dueDate;

reference/constraints/Bic.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ will contain a Business Identifier Code (BIC).
3737
class Transaction
3838
{
3939
/**
40-
* @Assert\Bic()
40+
* @Assert\Bic
4141
*/
4242
protected $businessIdentifierCode;
4343
}

reference/constraints/Blank.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ of an ``Author`` class were blank, you could do the following:
4242
class Author
4343
{
4444
/**
45-
* @Assert\Blank()
45+
* @Assert\Blank
4646
*/
4747
protected $firstName;
4848
}

reference/constraints/Country.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Basic Usage
2929
class User
3030
{
3131
/**
32-
* @Assert\Country()
32+
* @Assert\Country
3333
*/
3434
protected $country;
3535
}

reference/constraints/Date.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Basic Usage
3131
class Author
3232
{
3333
/**
34-
* @Assert\Date()
34+
* @Assert\Date
3535
*/
3636
protected $birthday;
3737
}

reference/constraints/DateTime.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Basic Usage
3131
class Author
3232
{
3333
/**
34-
* @Assert\DateTime()
34+
* @Assert\DateTime
3535
*/
3636
protected $createdAt;
3737
}

reference/constraints/IsNull.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ of an ``Author`` class exactly equal to ``null``, you could do the following:
3636
class Author
3737
{
3838
/**
39-
* @Assert\IsNull()
39+
* @Assert\IsNull
4040
*/
4141
protected $firstName;
4242
}

reference/constraints/Language.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Basic Usage
3030
class User
3131
{
3232
/**
33-
* @Assert\Language()
33+
* @Assert\Language
3434
*/
3535
protected $preferredLanguage;
3636
}

reference/constraints/Locale.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Basic Usage
3434
class User
3535
{
3636
/**
37-
* @Assert\Locale()
37+
* @Assert\Locale
3838
*/
3939
protected $locale;
4040
}

reference/constraints/NotBlank.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class were not blank, you could do the following:
4040
class Author
4141
{
4242
/**
43-
* @Assert\NotBlank()
43+
* @Assert\NotBlank
4444
*/
4545
protected $firstName;
4646
}

reference/constraints/NotNull.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class were not strictly equal to ``null``, you would:
3434
class Author
3535
{
3636
/**
37-
* @Assert\NotNull()
37+
* @Assert\NotNull
3838
*/
3939
protected $firstName;
4040
}

reference/constraints/Time.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ of the day when the event starts:
3434
class Event
3535
{
3636
/**
37-
* @Assert\Time()
37+
* @Assert\Time
3838
*/
3939
protected $startsAt;
4040
}

reference/constraints/UniqueEntity.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ your user table:
5252
* @var string $email
5353
*
5454
* @ORM\Column(name="email", type="string", length=255, unique=true)
55-
* @Assert\Email()
55+
* @Assert\Email
5656
*/
5757
protected $email;
5858

reference/constraints/Url.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Basic Usage
3232
class Author
3333
{
3434
/**
35-
* @Assert\Url()
35+
* @Assert\Url
3636
*/
3737
protected $bioUrl;
3838
}

reference/constraints/Valid.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ stores an ``Address`` instance in the ``$address`` property::
5757
class Address
5858
{
5959
/**
60-
* @Assert\NotBlank()
60+
* @Assert\NotBlank
6161
*/
6262
protected $street;
6363

validation.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ following:
5252
class Author
5353
{
5454
/**
55-
* @Assert\NotBlank()
55+
* @Assert\NotBlank
5656
*/
5757
public $name;
5858
}
@@ -536,7 +536,7 @@ class to have at least 3 characters.
536536
class Author
537537
{
538538
/**
539-
* @Assert\NotBlank()
539+
* @Assert\NotBlank
540540
* @Assert\Length(min=3)
541541
*/
542542
private $firstName;

validation/sequence_provider.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ entity and a new constraint group called ``Premium``:
178178
class User
179179
{
180180
/**
181-
* @Assert\NotBlank()
181+
* @Assert\NotBlank
182182
*/
183183
private $name;
184184

0 commit comments

Comments
 (0)