function Uuid::isValid
Same name in this branch
- 11.1.x core/lib/Drupal/Component/Uuid/Uuid.php \Drupal\Component\Uuid\Uuid::isValid()
Returns true if the provided string is a valid UUID
@psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, but under constant factory setups, this method operates in functionally pure manners
@psalm-assert-if-true =non-empty-string $uuid
Parameters
string $uuid A string to validate as a UUID:
Return value
bool True if the string is a valid UUID, false otherwise
1 call to Uuid::isValid()
- StringCodec::getBytes in vendor/
ramsey/ uuid/ src/ Codec/ StringCodec.php - Returns a byte string of the UUID
File
-
vendor/
ramsey/ uuid/ src/ Uuid.php, line 574
Class
- Uuid
- Uuid provides constants and static methods for working with and generating UUIDs
Namespace
Ramsey\UuidCode
public static function isValid(string $uuid) : bool {
/** @psalm-suppress ImpureMethodCall */
return self::getFactory()->getValidator()
->validate($uuid);
}