ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
IsString.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 2018 Fabian Schmid <fs@studer-raimann.ch> Extended GPL, see docs/LICENSE */
3
4
namespace
ILIAS\Validation\Constraints
;
5
6
use
ILIAS\Validation\Constraint
;
7
use
ILIAS\Data
;
8
use
ILIAS\Data\Result
;
9
17
class
IsString
extends
Custom
implements
Constraint
18
{
19
23
public
function
__construct
(Data\
Factory
$data_factory
, \
ilLanguage
$lng
)
24
{
25
parent::__construct(
26
function
($value) {
27
return
is_string($value);
28
},
29
function
(
$txt
, $value) {
30
return
$txt
(
"not_a_string"
, gettype($value));
31
},
32
$data_factory
,
33
$lng
34
);
35
}
36
}
ILIAS\Data\Result
Definition:
Error.php:4
ILIAS\Validation\Constraint
A constraint encodes some resrtictions on values.
Definition:
Constraint.php:14
ILIAS\Validation\Constraints\IsString
Definition:
IsString.php:17
ILIAS\Validation\Constraints\Custom\$lng
$lng
Definition:
Custom.php:20
Constraint
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:14
$txt
$txt
Definition:
error.php:11
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\Validation\Constraints\IsString\__construct
__construct(Data\Factory $data_factory, \ilLanguage $lng)
IsString constructor.
Definition:
IsString.php:23
ILIAS\Data
Definition:
ClientId.php:4
src
Validation
Constraints
IsString.php
Generated on Thu Jan 16 2025 19:02:38 for ILIAS by
1.8.13 (using
Doxyfile
)