我想知道每个验证器中的这些代码有什么用途,即https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Constraints/NotBlank.php#L24中
class NotBlank extends Constraint
{
const IS_BLANK_ERROR = 'c1051bb4-d103-4f74-8988-acbcafc7fdc3';
我在 http://symfony.com/doc/master/validation/custom_constraint.html 中都找不到任何有关它的文档。 :使用什么算法来生成它们?
最佳答案
这似乎是一个UUID。来自 Wikipedia :
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems. The term globally unique identifier (GUID) is also used.
When generated according to the standard methods, UUIDs are for practical purposes unique, without depending for their uniqueness on a central registration authority or coordination between the parties generating them, unlike most other numbering schemes. While the probability that a UUID will be duplicated is not zero, it is close enough to zero to be negligible.
关于symfony 验证器错误名称常量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51356751/