ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
IsNumeric.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2017 Timon Amstutz <timon.amstutz@ilub.unibe.ch> Extended GPL, see
3docs/LICENSE */
4
6
8use ILIAS\Data;
10
11class IsNumeric extends Custom implements Constraint
12{
14 {
15 parent::__construct(
16 function ($value) {
17 return is_numeric($value);
18 },
19 function ($txt, $value) {
20 return $txt("not_numeric", $value);
21 },
23 $lng
24 );
25 }
26}
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)
Definition: IsNumeric.php:13
language handling
$txt
Definition: error.php:11
A constraint encodes some resrtictions on values.
Definition: Constraint.php:15