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
3 docs/LICENSE */
4 
6 
8 use ILIAS\Data;
10 
11 class 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 }
A constraint encodes some resrtictions on values.
Definition: Constraint.php:14
Builds data types.
Definition: Factory.php:14
$txt
Definition: error.php:11
language handling
__construct(Data\Factory $data_factory, \ilLanguage $lng)
Definition: IsNumeric.php:13