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

[Uid] use one class per type of UUID#36066

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
nicolas-grekas merged 1 commit intosymfony:masterfromnicolas-grekas:uuid-classes
Mar 14, 2020

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedMar 13, 2020
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

(embeds#36064 for now)

Would it make sense to have one class per type of UUID?
This aligns the type system and UUID types, so that one could type hint e.g.UuidV4 $uuid.

This PR does so.UuidV1/2/3/4 andNullUuid all extend the baseUuid class, which provides common methods and the factories needed to create each king of UUID.

This means we don't need thegetType() nor theisNull() methods since they can be replaced by instanceof checks.

As expected,getTime() andgetMac() then now exist only on theUuidV1 class - no need for any version check nor anyLogicException anymore.

Each type is guaranteed to contain a UUID that matches its class' type. The baseUuid class is used for the "no type" type.

jakzal, linaori, ro0NL, Koc, and bigfoot90 reacted with thumbs up emoji
@nicolas-grekasnicolas-grekasforce-pushed theuuid-classes branch 2 times, most recently from96561be to8441fb0CompareMarch 13, 2020 21:22
@fabpot
Copy link
Member

#36064 has been merged now.

@nicolas-grekas
Copy link
MemberAuthor

thanks, rebased

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jakzaljakzaljakzal left review comments

@fabpotfabpotfabpot approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@lyrixxlyrixxlyrixx approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

6 participants
@nicolas-grekas@fabpot@javiereguiluz@jakzal@lyrixx@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp