-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Add support for types (ALL*
, LOCAL_*
, UNIVERSAL_*
, UNICAST_*
, MULTICAST_*
, BROADCAST
) in MacAddress
constraint
#54473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
Naming that setting |
06d9fdd
to
3bd9aea
Compare
@stof thank you! I changed the code & naming a bit, think it's a bit cleaner now. Thought about splitting the different types (unicast/multicast & local/universal) into different attributes (don't ask me about possibilities for attribute naming...), but this would increase the complexity a bit, if someone somehow needs to validate e.g. broadcast ( PS: May we could also rename |
ALL
, LOCAL_*
, UNIVERSAL_*
, UNICAST_*
, MULTICAST_*
) in MacAddress
constraint
589cd04
to
300cf1c
Compare
I added broadcast validation & also renamed |
64584b4
to
3587c7d
Compare
ALL
, LOCAL_*
, UNIVERSAL_*
, UNICAST_*
, MULTICAST_*
) in MacAddress
constraintALL*
, LOCAL_*
, UNIVERSAL_*
, UNICAST_*
, MULTICAST_*
, BROADCAST
) in MacAddress
constraint
93d6f02
to
02d3f21
Compare
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
f7f8818
to
663d801
Compare
638ab7f
to
cc07a5a
Compare
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Constraints/MacAddressValidator.php
Outdated
Show resolved
Hide resolved
public function __construct( | ||
public string $message = 'This value is not a valid MAC address.', | ||
public string $type = self::ALL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a BC break as the constraint was added in 7.1.
…`UNICAST_*`, `MULTICAST_*`, `BROADCAST`) in `MacAddress` constraint
e42d81f
to
16b9210
Compare
Thank you @Ninos. |
…NIVERSAL_*`, `UNICAST_*`, `MULTICAST_*`, `BROADCAST`) in `MacAddress` constraint (Ninos) This PR was merged into the 7.1 branch. Discussion ---------- [Validator] Add support for types (`ALL*`, `LOCAL_*`, `UNIVERSAL_*`, `UNICAST_*`, `MULTICAST_*`, `BROADCAST`) in `MacAddress` constraint See also following pull request: symfony/symfony#54473 Commits ------- 0ed185a [Validator] Add support for types (`ALL*`, `LOCAL_*`, `UNIVERSAL_*`, `UNICAST_*`, `MULTICAST_*`, `BROADCAST`) in `MacAddress` constraint
Before some months we added the
MacAddress
contraint to v7.1, see also #51862This MR also adds support for validating unicast/multicast, local/universal or any (default) mac address versions. For more informations, see:
https://en.wikipedia.org/wiki/MAC_address#Ranges_of_group_and_locally_administered_addresses
PS: May we should renamePRIVATE
&PUBLIC
toLOCAL
&UNIVERSAL
to be a bit more consistent with naming in mac address standard. Also then maybeversion
attribute totype
. .. Just let me know (already prepared changes locally) :-)