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