ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
HasMinLength.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Refinery\String;
22
23use ILIAS\Data;
25
27{
28 public function __construct(int $min_length, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
29 {
31 static function ($value) use ($min_length): bool {
32 return strlen($value) >= $min_length;
33 },
34 static function ($txt, $value) use ($min_length): string {
35 $len = strlen($value);
36 return $txt("not_min_length", $len, $min_length);
37 },
38 $data_factory,
39 $lng
40 );
41 }
42}
Builds data types.
Definition: Factory.php:36
__construct(int $min_length, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
$txt
Definition: error.php:31
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $lng
Definition: privfeed.php:31