-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
Inconsistent results between fromString and isValid methods. #531
Comments
The validator expects the UUID to be formatted as a UUID string (including dashes): uuid/src/Validator/GenericValidator.php Line 32 in 758682d
While the uuid/src/Codec/StringCodec.php Lines 107 to 130 in 758682d
I'm not sure this is a bug, since changing the validator could cause applications to break, if they assume the strings must have dashes in them, and if we require dashes in the value passed to |
Thank you for your explanation @ramsey Therefore it would be nice to have a |
Description
When creating a UUID instance from a string without dashes (ie:
00000000000000000000000000000000
) it works, but when receiving the same string to validate if it's a valid UUID it fails, which is inconsistent.The library should not be able to create a UUID for a string that is not valid.
Steps to reproduce
00000000000000000000000000000000
string. It returns a UUID instance00000000000000000000000000000000
using the isValid function. It returns false.Expected behavior
The library should not be able to create a UUID for a string that is not valid.
Screenshots or output
Input and output from Laravel tinker:
Environment details
Additional context
The text was updated successfully, but these errors were encountered: