@@ -19,12 +19,12 @@ Basic Usage
19
19
20
20
.. code-block :: php-annotations
21
21
22
- // src/Entity/Author .php
22
+ // src/Entity/NetworkSettings .php
23
23
namespace App\Entity;
24
24
25
25
use Symfony\Component\Validator\Constraints as Assert;
26
26
27
- class Author
27
+ class NetworkSettings
28
28
{
29
29
/**
30
30
* @Assert\Cidr
@@ -34,12 +34,12 @@ Basic Usage
34
34
35
35
.. code-block :: php-attributes
36
36
37
- // src/Entity/Author .php
37
+ // src/Entity/NetworkSettings .php
38
38
namespace App\Entity;
39
39
40
40
use Symfony\Component\Validator\Constraints as Assert;
41
41
42
- class Author
42
+ class NetworkSettings
43
43
{
44
44
#[Assert\Cidr]
45
45
protected $cidrNotation;
@@ -48,7 +48,7 @@ Basic Usage
48
48
.. code-block :: yaml
49
49
50
50
# config/validator/validation.yaml
51
- App\Entity\Author :
51
+ App\Entity\NetworkSettings :
52
52
properties :
53
53
cidrNotation :
54
54
- Cidr : ~
@@ -61,7 +61,7 @@ Basic Usage
61
61
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
62
62
xsi : schemaLocation =" http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd" >
63
63
64
- <class name =" App\Entity\Author " >
64
+ <class name =" App\Entity\NetworkSettings " >
65
65
<property name =" cidrNotation" >
66
66
<constraint name =" Cidr" />
67
67
</property >
@@ -70,13 +70,13 @@ Basic Usage
70
70
71
71
.. code-block :: php
72
72
73
- // src/Entity/Author .php
73
+ // src/Entity/NetworkSettings .php
74
74
namespace App\Entity;
75
75
76
76
use Symfony\Component\Validator\Constraints as Assert;
77
77
use Symfony\Component\Validator\Mapping\ClassMetadata;
78
78
79
- class Author
79
+ class NetworkSettings
80
80
{
81
81
public static function loadValidatorMetadata(ClassMetadata $metadata)
82
82
{
@@ -99,34 +99,34 @@ Options
99
99
This message is shown if the string is not a valid CIDR notation.
100
100
101
101
``netmaskMin ``
102
- ~~~~~~~~~~~
102
+ ~~~~~~~~~~~~~~
103
103
104
104
**type **: ``integer `` **default **: ``0 ``
105
105
106
106
It's a constraint for the lowest value a valid netmask may have.
107
107
108
108
``netmaskMax ``
109
- ~~~~~~~~~~~
109
+ ~~~~~~~~~~~~~~
110
110
111
- **type **: ``string `` **default **: ``32 for IPv4 or 128 for IPv6 ``
111
+ **type **: ``string `` **default **: ``32 `` for IPv4 or `` 128 `` for IPv6
112
112
113
113
It's a constraint for the biggest value a valid netmask may have.
114
114
115
115
``netmaskRangeViolationMessage ``
116
- ~~~~~~~~~~~
116
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117
117
118
118
**type **: ``string `` **default **: ``The value of the netmask should be between {{ min }} and {{ max }}. ``
119
119
120
- This message is shown if the value of the CIDR's netmask is bigger then the value of the ` max_ ` or lower than
121
- the value of the `min_ ` .
120
+ This message is shown if the value of the CIDR's netmask is bigger than the
121
+ `` netmaskMax `` value or lower than the `` netmaskMin `` value .
122
122
123
123
You can use the following parameters in this message:
124
124
125
125
=============== ==============================================================
126
126
Parameter Description
127
127
=============== ==============================================================
128
- ``{{ min }} `` The minimum value a CIDR netmask may have
129
- ``{{ max }} `` The maximum value a CIDR netmask may have
128
+ ``{{ min }} `` The minimum value a CIDR netmask may have
129
+ ``{{ max }} `` The maximum value a CIDR netmask may have
130
130
=============== ==============================================================
131
131
132
132
.. include :: /reference/constraints/_payload-option.rst.inc
@@ -137,15 +137,10 @@ Parameter Description
137
137
**type **: ``string `` **default **: ``all ``
138
138
139
139
This determines exactly *how * the CIDR notation is validated and can take one
140
- of a variety of different values:
141
-
142
- **All ranges **
140
+ of these values:
143
141
144
- ``4 ``
145
- Validates for CIDR notations that have an IPv4.
146
- ``6 ``
147
- Validates for CIDR notations that have an IPv6.
148
- ``all ``
149
- Validates all CIDR formats
142
+ * ``4 ``: validates for CIDR notations that have an IPv4;
143
+ * ``6 ``: validates for CIDR notations that have an IPv6;
144
+ * ``all ``: validates all CIDR formats.
150
145
151
146
.. _`CIDR` : https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
0 commit comments