Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Validator] Add support for types (ALL*,LOCAL_*,UNIVERSAL_*,UNICAST_*,MULTICAST_*,BROADCAST) inMacAddress 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:7.1fromNinos:constraint-mac-versions
Apr 13, 2024

Conversation

@Ninos
Copy link
Contributor

@NinosNinos commentedApr 3, 2024
edited
Loading

QA
Branch?7.1
Bug fix?no
New feature?yes
Deprecations?no
LicenseMIT

Before some months we added theMacAddress contraint to v7.1, see also#51862

This 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) :-)

@stof
Copy link
Member

stof commentedApr 3, 2024

Naming that settingversion is indeed weird as it is not a version at all. And using the actual names of the concept rather thanPUBLIC andPRIVATE makes sense.

Ninos reacted with thumbs up emoji

@NinosNinosforce-pushed theconstraint-mac-versions branch from06d9fdd to3bd9aeaCompareApril 3, 2024 14:54
@Ninos
Copy link
ContributorAuthor

Ninos commentedApr 3, 2024
edited
Loading

Naming that settingversion is indeed weird as it is not a version at all. And using the actual names of the concept rather thanPUBLIC andPRIVATE makes sense.

@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 (ff:ff:ff:ff:ff:ff). Currently broadcast isLOCAL_MULTICAST, so not fully wrong.
I just didn't addBROADCAST as additional version, because this needs a bit more coding (we need to format the mac before validation & then check e.g. forffffffffffff or bits/int), haven't found a more elegant/short solution. And normally if someone needs to validate against broadcast, this could be done withLOCAL_MULTICAST + may additional Contraint (EqualTo?).

PS: May we could also renameversion to e.g.type, but for me with current naming it's ok now. Just let me know :-)

@NinosNinos changed the title[Validator] Add support for versions (PUBLIC, PRIVATE, ALL) in MacAddress constraint[Validator] Add support for versions (ALL,LOCAL_*,UNIVERSAL_*,UNICAST_*,MULTICAST_*) inMacAddress constraintApr 3, 2024
@NinosNinosforce-pushed theconstraint-mac-versions branch 3 times, most recently from589cd04 to300cf1cCompareApril 3, 2024 17:16
@Ninos
Copy link
ContributorAuthor

I added broadcast validation & also renamedversion totype (may in some hundreds years there will be a new mac address version... :D)

@NinosNinosforce-pushed theconstraint-mac-versions branch from64584b4 to3587c7dCompareApril 3, 2024 17:27
@NinosNinos changed the title[Validator] Add support for versions (ALL,LOCAL_*,UNIVERSAL_*,UNICAST_*,MULTICAST_*) inMacAddress constraint[Validator] Add support for types (ALL*,LOCAL_*,UNIVERSAL_*,UNICAST_*,MULTICAST_*,BROADCAST) inMacAddress constraintApr 3, 2024
@NinosNinosforce-pushed theconstraint-mac-versions branch 3 times, most recently from93d6f02 to02d3f21CompareApril 3, 2024 17:51
@NinosNinosforce-pushed theconstraint-mac-versions branch fromf7f8818 to663d801CompareApril 4, 2024 14:49
@NinosNinosforce-pushed theconstraint-mac-versions branch 3 times, most recently from638ab7f tocc07a5aCompareApril 11, 2024 19:40
*/
publicfunction__construct(
publicstring$message ='This value is not a valid MAC address.',
publicstring$type =self::ALL,
Copy link
Member

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.

Ninos reacted with thumbs up emoji
…`UNICAST_*`, `MULTICAST_*`, `BROADCAST`) in `MacAddress` constraint
@fabpotfabpotforce-pushed theconstraint-mac-versions branch frome42d81f to16b9210CompareApril 13, 2024 16:26
@fabpot
Copy link
Member

Thank you@Ninos.

Ninos reacted with heart emoji

@fabpotfabpot merged commite4c7068 intosymfony:7.1Apr 13, 2024
@NinosNinos deleted the constraint-mac-versions branchApril 13, 2024 16:33
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestApr 15, 2024
…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` constraintSee also following pull request:symfony/symfony#54473Commits-------0ed185a [Validator] Add support for types (`ALL*`, `LOCAL_*`, `UNIVERSAL_*`, `UNICAST_*`, `MULTICAST_*`, `BROADCAST`) in `MacAddress` constraint
@fabpotfabpot mentioned this pull requestMay 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof requested changes

@xabbuhxabbuhxabbuh left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

7.1

Development

Successfully merging this pull request may close these issues.

6 participants

@Ninos@stof@fabpot@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp