@@ -25,18 +25,18 @@ class NoSuspiciousCharacters extends Constraint
2525{
2626 /**
2727 * 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 }).
2929 */
3030 public const CHECK_RESTRICTION_LEVEL = 16 ;
3131
3232 /**
3333 * Check a string for the presence of invisible characters such as zero-width spaces,
3434 * or character sequences that are likely not to display such as multiple occurrences of the same non-spacing mark.
3535 */
36- public const CHECK_INVISIBLE = \Spoofchecker:: INVISIBLE ;
36+ public const CHECK_INVISIBLE = 32 ;
3737
3838 /** 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 ;
4040
4141 /**
4242 * Check that a string does not mix numbers from different numbering systems;
@@ -50,14 +50,22 @@ class NoSuspiciousCharacters extends Constraint
5050 */
5151 public const CHECK_HIDDEN_OVERLAY = 256 ;
5252
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+
5360 public $ message = 'This value is suspicious. ' ;
5461 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 ;
5663 public array $ profileLocales = [];
5764 public bool $ addCurrentLocaleToProfile = true ;
5865
5966 /**
6067 * @param int-mask-of<self::CHECK_*>|null $checks
68+ * @param self::RESTRICTION_LEVEL_*|null $restrictionLevel
6169 */
6270 public function __construct (
6371 array $ options = null ,
0 commit comments