ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
IsNumeric.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Refinery\Numeric;
22 
24 use ILIAS\Data;
25 
26 class IsNumeric extends Constraint
27 {
28  public function __construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng)
29  {
31  static function ($value): bool {
32  return is_numeric($value);
33  },
34  static function ($txt, $value): string {
35  if ('' === $value) {
36  return (string) $txt("not_numeric_empty_string");
37  }
38 
39  return (string) $txt("not_numeric", $value);
40  },
41  $data_factory,
42  $lng
43  );
44  }
45 }
Interface Observer Contains several chained tasks and infos about them.
A constraint encodes some resrtictions on values.
Definition: Constraint.php:31
Factory for Date Formats.
Definition: Factory.php:26
__construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng)
Definition: IsNumeric.php:28
$txt
Definition: error.php:31
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31