ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
HasMinLength.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 HasMinLength extends Constraint
27 {
28  public function __construct(int $min_length, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
29  {
31  static function (Data\Password $value) use ($min_length): bool {
32  return strlen($value->toString()) >= $min_length;
33  },
34  static function ($value) use ($min_length): string {
35  return "Password has a length less than '$min_length'.";
36  },
37  $data_factory,
38  $lng
39  );
40  }
41 }
Interface Observer Contains several chained tasks and infos about them.
A password is used as part of credentials for authentication.
Definition: Password.php:30
__construct(int $min_length, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
Builds data types.
Definition: Factory.php:35
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31