ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
HasSpecialChars.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Refinery\Password;
22 
24 use ILIAS\Data;
25 
26 class HasSpecialChars extends Constraint
27 {
28  private const ALLOWED_CHARS = '/[,_.\-#\+\*?!%§\(\)\$]/u';
29 
30  public function __construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng)
31  {
33  static function (Data\Password $value): bool {
34  return (bool) preg_match(self::ALLOWED_CHARS, $value->toString());
35  },
36  static function ($value): string {
37  return "Password must contain special chars.";
38  },
39  $data_factory,
40  $lng
41  );
42  }
43 }
Interface Observer Contains several chained tasks and infos about them.
__construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng)
A password is used as part of credentials for authentication.
Definition: Password.php:30
Builds data types.
Definition: Factory.php:35
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31