ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
5
7use ILIAS\Data;
9
17class IsString extends Custom implements Constraint
18{
19
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 },
33 $lng
34 );
35 }
36}
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:15
__construct(Data\Factory $data_factory, \ilLanguage $lng)
IsString constructor.
Definition: IsString.php:23
language handling
$txt
Definition: error.php:11
A constraint encodes some resrtictions on values.
Definition: Constraint.php:15