ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
HasMinLength.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 2018 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4
namespace
ILIAS\Validation\Constraints\Password
;
5
6
use
ILIAS\Validation\Constraints
;
7
use
ILIAS\Validation\Constraint
;
8
use
ILIAS\Data
;
9
10
class
HasMinLength
extends
Constraints\Custom
implements
Constraint
11
{
15
protected
$min_length
;
16
17
public
function
__construct
(
int
$min_length
, Data\
Factory
$data_factory
, \
ilLanguage
$lng
)
18
{
19
$this->min_length =
$min_length
;
20
parent::__construct(
21
function
(Data\
Password
$value) {
22
return
strlen($value->toString()) >= $this->min_length;
23
},
24
function
($value) {
25
return
"Password has a length less than '{$this->min_length}'."
;
26
},
27
$data_factory
,
28
$lng
29
);
30
}
31
}
ILIAS\Validation\Constraints\HasMinLength\$min_length
$min_length
Definition:
HasMinLength.php:15
ILIAS\Validation\Constraints\Password
Definition:
Factory.php:4
ILIAS\Validation\Constraint
A constraint encodes some resrtictions on values.
Definition:
Constraint.php:14
ILIAS\Validation\Constraints\Custom\$lng
$lng
Definition:
Custom.php:20
ILIAS\Validation\Constraints\Password\HasMinLength\$min_length
$min_length
Definition:
HasMinLength.php:15
ILIAS\Data\Password
A password is used as part of credentials for authentication.
Definition:
Password.php:13
Constraint
ILIAS\Validation\Constraints\Password\HasMinLength\__construct
__construct(int $min_length, Data\Factory $data_factory, \ilLanguage $lng)
Definition:
HasMinLength.php:17
ILIAS\Validation\Constraints\HasMinLength
Definition:
HasMinLength.php:10
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:14
ILIAS\Validation\Constraints\Custom
Definition:
Custom.php:10
ILIAS\Validation\Constraints
Definition:
Custom.php:4
ILIAS\Validation\Constraints\Custom\$data_factory
$data_factory
Definition:
Custom.php:15
ilLanguage
language handling
Definition:
class.ilLanguage.php:26
php
ILIAS\Data
Definition:
ClientId.php:4
src
Validation
Constraints
Password
HasMinLength.php
Generated on Thu Jan 30 2025 19:02:12 for ILIAS by
1.8.13 (using
Doxyfile
)