@@ -25,18 +25,18 @@ class NoSuspiciousCharacters extends Constraint
25
25
{
26
26
/**
27
27
* Check that a string satisfies the requirements for the specified restriction level
28
- * (by default {@see \Spoofchecker::HIGHLY_RESTRICTIVE }).
28
+ * (by default {@see self::RESTRICTION_LEVEL_HIGH }).
29
29
*/
30
30
public const CHECK_RESTRICTION_LEVEL = 16 ;
31
31
32
32
/**
33
33
* Check a string for the presence of invisible characters such as zero-width spaces,
34
34
* or character sequences that are likely not to display such as multiple occurrences of the same non-spacing mark.
35
35
*/
36
- public const CHECK_INVISIBLE = \Spoofchecker:: INVISIBLE ;
36
+ public const CHECK_INVISIBLE = 32 ;
37
37
38
38
/** Check a string contains only characters allowed by the configured profile. */
39
- public const CHECK_CHAR_LIMIT = \Spoofchecker:: CHAR_LIMIT ;
39
+ public const CHECK_CHAR_LIMIT = 64 ;
40
40
41
41
/**
42
42
* Check that a string does not mix numbers from different numbering systems;
@@ -50,14 +50,22 @@ class NoSuspiciousCharacters extends Constraint
50
50
*/
51
51
public const CHECK_HIDDEN_OVERLAY = 256 ;
52
52
53
+ public const RESTRICTION_LEVEL_ASCII = 268435456 ;
54
+ public const RESTRICTION_LEVEL_SINGLE_SCRIPT = 536870912 ;
55
+ public const RESTRICTION_LEVEL_HIGH = 805306368 ;
56
+ public const RESTRICTION_LEVEL_MODERATE = 1073741824 ;
57
+ public const RESTRICTION_LEVEL_MINIMAL = 1342177280 ;
58
+ public const RESTRICTION_LEVEL_NONE = 1610612736 ;
59
+
53
60
public $ message = 'This value is suspicious. ' ;
54
61
public int $ checks = self ::CHECK_RESTRICTION_LEVEL | self ::CHECK_INVISIBLE | self ::CHECK_CHAR_LIMIT | self ::CHECK_MIXED_NUMBERS | self ::CHECK_HIDDEN_OVERLAY ;
55
- public int $ restrictionLevel = \Spoofchecker:: HIGHLY_RESTRICTIVE ;
62
+ public int $ restrictionLevel = self :: RESTRICTION_LEVEL_HIGH ;
56
63
public array $ profileLocales = [];
57
64
public bool $ addCurrentLocaleToProfile = true ;
58
65
59
66
/**
60
67
* @param int-mask-of<self::CHECK_*>|null $checks
68
+ * @param self::RESTRICTION_LEVEL_*|null $restrictionLevel
61
69
*/
62
70
public function __construct (
63
71
array $ options = null ,
0 commit comments