Commit 88409b7
Fixed hydration of the Network class with IPv6 addresses (#339)
* IPv6 the CIDR field assigned with wrong type and notation.
For IPv6 networks the netmask is integer and the CIDR field is assigned with `int` to a field with `string` constraint. The netmask in this case represents the number for allow networks.
The IPv6 address `2b03:b0c0:2:d0::102e:d001` should have the CIDR notation `2b03:b0c0:2:d0::102e:d001/64` or `2b03:b0c0:0002:00d0:0000:0000:0000:0000/64`.
I'm not 100% sure what the netmask value can be on the api die, is it always int? or can it come as string? that's why the check for int.
* Added 'networks' to droplet test fully checking build() logic.
* Refactoring the networks fix code to comply with phpstan rules.
* Tested multiple solutions, this is the nicest and most minimal one, and probably more correct since we are not manipulating values we iterate on.
* This also this resulted some cleanup on the baseline rules file.
* Cleanup
* Fixed code style
* Update CHANGELOG.md
* IPv6 netmasks are always integers
---------
Co-authored-by: alkavan <igal@alkontek.com>
Co-authored-by: Graham Campbell <GrahamCampbell@users.noreply.github.com>1 parent dfb125c commit 88409b7
File tree
4 files changed
+33
-17
lines changed- src/Entity
- tests
4 files changed
+33
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | 195 | | |
208 | 196 | | |
209 | 197 | | |
210 | | - | |
| 198 | + | |
211 | 199 | | |
212 | 200 | | |
213 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
98 | 116 | | |
99 | 117 | | |
100 | 118 | | |
| |||
0 commit comments