Skip to content

Add support for UUID validation using ramsey/uuid to support all UUID…#1542

Closed
srjlewis wants to merge 6 commits into
Respect:2.4from
srjlewis:2.4
Closed

Add support for UUID validation using ramsey/uuid to support all UUID…#1542
srjlewis wants to merge 6 commits into
Respect:2.4from
srjlewis:2.4

Conversation

@srjlewis
Copy link
Copy Markdown
Contributor

… versions

As suggested in #1471

Defaults to the original behavior if ramsey/uuid is not installed or explicitly disabled.

srjlewis added 3 commits May 22, 2025 15:23
… versions

As suggested in Respect#1471

Defaults to the original behavior if ramsey/uuid is not installed or explicitly disabled.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2025

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Please upload report for BASE (2.4@7f4b3b3). Learn more about missing BASE report.

Files with missing lines Patch % Lines
library/Rules/Uuid.php 81.81% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             2.4    #1542   +/-   ##
======================================
  Coverage       ?   93.91%           
  Complexity     ?      462           
======================================
  Files          ?       99           
  Lines          ?     1265           
  Branches       ?        0           
======================================
  Hits           ?     1188           
  Misses         ?       77           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread library/Rules/Uuid.php
public function __construct(?int $version = null)
public function __construct(?int $version = null, ?bool $useRamseyUuid = null)
{
if ($useRamseyUuid && !$this->ramseyUuidIsLoaded()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's really awesome, thank you so much! I would say though, we could aways use RamseyUuid for this rule, we just need to require it to be install. In that case, this branch should be based on main, to be released with the next major version. What do you say?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying not to introduce any BC breaks and allow RamseyUuid to be optional.

But if you are good with making RamseyUuid required, it would clean up the code loads.

I was targeting this at 2.4 so it could be used quicker, has I dont know how far version 3.0 is from release.

I will make the chages to make RamseyUuid a required and clean up the code 😁

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, just looking at the main version, I will create a new version for the main and leave the PR here if you want to merge this into 2.4

@srjlewis srjlewis changed the base branch from 2.4 to main May 23, 2025 13:10
@srjlewis srjlewis changed the base branch from main to 2.4 May 23, 2025 13:10
@henriquemoody
Copy link
Copy Markdown
Member

Closing this branch as it was already implemented on 2b36476 and I don't plan to add new feature to version 2.4

Again, thank you for contributing, @srjlewis!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants