ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
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
5
namespace
ILIAS\Refinery\Numeric
;
6
7
use
ILIAS\Refinery\Constraint
;
8
use
ILIAS\Refinery\Custom\Constraint
as CustomConstraint;
9
use
ILIAS\Data
;
10
11
class
IsNumeric
extends
CustomConstraint implements
Constraint
12
{
13
public
function
__construct
(Data\
Factory
$data_factory
, \
ilLanguage
$lng
)
14
{
15
parent::__construct
(
16
function
($value) {
17
return
is_numeric($value);
18
},
19
function
(
$txt
, $value) {
20
if
(
''
=== $value) {
21
return
$txt
(
"not_numeric_empty_string"
);
22
}
23
24
return
$txt
(
"not_numeric"
, $value);
25
},
26
$data_factory
,
27
$lng
28
);
29
}
30
}
php
An exception for terminatinating execution or to throw for unit testing.
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:20
ILIAS\Refinery\Custom\Constraint
Definition:
Constraint.php:13
ILIAS\Refinery\Custom\Constraint\$data_factory
$data_factory
Definition:
Constraint.php:20
ILIAS\Refinery\Custom\Constraint\$lng
$lng
Definition:
Constraint.php:25
ILIAS\Refinery\Numeric\IsNumeric
Definition:
IsNumeric.php:12
ILIAS\Refinery\Numeric\IsNumeric\__construct
__construct(Data\Factory $data_factory, \ilLanguage $lng)
Definition:
IsNumeric.php:13
ilLanguage
language handling
Definition:
class.ilLanguage.php:27
$txt
$txt
Definition:
error.php:13
ILIAS\Refinery\Constraint
A constraint encodes some resrtictions on values.
Definition:
Constraint.php:15
ILIAS\Data
Definition:
Alphanumeric.php:10
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Definition:
PluginProviderHelper.php:30
ILIAS\Refinery\Numeric
Definition:
Group.php:4
src
Refinery
Numeric
IsNumeric.php
Generated on Fri Oct 3 2025 20:01:15 for ILIAS by
1.9.4 (using
Doxyfile
)