Skip to content
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

fromStrictString method #533

Open
wants to merge 6 commits into
base: 4.x
Choose a base branch
from

Conversation

rogervila
Copy link

Description

Provide a new fromStrictString method that validates the string against the isValid method.

Motivation and context

Fix #531

How has this been tested?

The new method is covered by Unit tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.

@rogervila
Copy link
Author

Hi @ramsey, looks like there is a python issue on the docs build step. Could you review it? thanks!

*
* @psalm-pure
*/
public function fromStrictString(string $uuid): UuidInterface;
Copy link
Owner

Choose a reason for hiding this comment

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

Interface changes will require a major version bump.

@ramsey
Copy link
Owner

ramsey commented Jan 26, 2024

@rogervila Thanks for the PR. Unfortunately, I'm unemployed without any income, and I'm spending every waking minute on job searching, so I'll be unable to give this much attention until I've sorted out my financial situation. Thank you for your understanding. 🙂

docs/quickstart.rst Outdated Show resolved Hide resolved
Co-authored-by: Ben Ramsey <ben@benramsey.com>
@rogervila rogervila marked this pull request as ready for review January 30, 2024 12:57
@rogervila
Copy link
Author

@rogervila Thanks for the PR. Unfortunately, I'm unemployed without any income, and I'm spending every waking minute on job searching, so I'll be unable to give this much attention until I've sorted out my financial situation. Thank you for your understanding. 🙂

Don't worry, first things first 🙂

@ramsey
Copy link
Owner

ramsey commented Apr 27, 2024

Can you provide some more details on when a user might use fromStrictString() instead of fromString()? I've read #531, but it sounds like an application-specific or domain-specific problem, rather than a library problem, since you want your application to be more strict than the library when creating UUIDs from strings.

Another problem is the introduction of a new interface method. This breaks BC and would need to wait until a later major version of this library.

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.

Inconsistent results between fromString and isValid methods.
2 participants