ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
HasSpecialChars.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 namespace ILIAS\Refinery\Password;
22 
24 use ILIAS\Data;
25 use ilLanguage;
26 
28 {
29  private const ALLOWED_CHARS = '/[,_.\-#\+\*?!%§\(\)\$]/u';
30 
31  public function __construct(Data\Factory $data_factory, ilLanguage $lng)
32  {
34  static function (Data\Password $value): bool {
35  return (bool) preg_match(self::ALLOWED_CHARS, $value->toString());
36  },
37  static function ($value): string {
38  return "Password must contain special chars.";
39  },
40  $data_factory,
41  $lng
42  );
43  }
44 }
$lng
A constraint encodes some resrtictions on values.
Definition: Constraint.php:31
A password is used as part of credentials for authentication.
Definition: Password.php:16
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Group.php:21
__construct(Container $dic, ilPlugin $plugin)
__construct(Data\Factory $data_factory, ilLanguage $lng)