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

Appearance settings

[FWB][Serializer][Form][Validator] Uid integration #36317

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

Closed
wants to merge 33 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Uid Constraint.
  • Loading branch information
Guillaume Pédelagrabe committed Apr 8, 2020
commit 636b36711f6fbb93839b4374f5857a60596559e0
48 changes: 29 additions & 19 deletions 48 src/Symfony/Component/Validator/Constraints/Uid.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,41 @@ class Uid extends Constraint
self::INVALID_VERSIONS_ERROR => 'INVALID_VERSIONS_ERROR',
];

const TYPE_UUID = 'UUID';
const TYPE_ULID = 'ULID';

const V1 = 1;
const V3 = 3;
const V4 = 4;
const V5 = 5;
const V6 = 6;
public const TYPE_UUID = 'UUID';
public const TYPE_ULID = 'ULID';

/**
* @var string
* @var string[]
*
* @internal
*/
public $message = 'This is neither a valid UUID nor ULID.';
public static $availableTypes = [
self::TYPE_UUID,
self::TYPE_ULID,
];

/**
* @var string
*/
public $ulidMessage = 'This is not a valid ULID.';
public const V1 = 1;
public const V3 = 3;
public const V4 = 4;
public const V5 = 5;
public const V6 = 6;

/**
* @var string
* @var int[]
*
* @internal
*/
public $uuidMessage = 'This is not a valid UUID.';
public static $availableVersions = [
self::V1,
self::V3,
self::V4,
self::V5,
self::V6,
];

/**
* @var string
*/
public $message = 'This is neither a valid UUID nor ULID.';
public $ulidMessage = 'This is not a valid ULID.';
public $uuidMessage = 'This is not a valid UUID.';
public $versionsMessage = 'This UUID does not match expected versions.';

/**
Expand All @@ -72,6 +80,8 @@ class Uid extends Constraint

public function __construct($options = null)
{


parent::__construct($options);

if (null !== $this->normalizer && !\is_callable($this->normalizer)) {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.