ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
LookupRefValidations.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
PhpOffice\PhpSpreadsheet\Calculation\LookupRef
;
4
5
use
PhpOffice\PhpSpreadsheet\Calculation\Exception
;
6
use
PhpOffice\PhpSpreadsheet\Calculation\Functions
;
7
8
class
LookupRefValidations
9
{
13
public
static
function
validateInt
($value): int
14
{
15
if
(!is_numeric($value)) {
16
if
(
Functions::isError
($value)) {
17
throw
new
Exception
($value);
18
}
19
20
throw
new
Exception
(
Functions::VALUE
());
21
}
22
23
return
(
int
) floor((
float
) $value);
24
}
25
29
public
static
function
validatePositiveInt
($value,
bool
$allowZero =
true
): int
30
{
31
$value = self::validateInt($value);
32
33
if
(($allowZero ===
false
&& $value <= 0) || $value < 0) {
34
throw
new
Exception
(
Functions::VALUE
());
35
}
36
37
return
$value;
38
}
39
}
PhpOffice\PhpSpreadsheet\Calculation\LookupRef
Definition:
Address.php:3
PhpOffice\PhpSpreadsheet\Calculation\Functions\isError
static isError($value='')
IS_ERROR.
Definition:
Functions.php:360
Exception
Functions
php
PhpOffice\PhpSpreadsheet\Calculation\Functions\VALUE
static VALUE()
VALUE.
Definition:
Functions.php:229
PhpOffice\PhpSpreadsheet\Calculation\LookupRef\LookupRefValidations\validateInt
static validateInt($value)
Definition:
LookupRefValidations.php:13
PhpOffice\PhpSpreadsheet\Calculation\LookupRef\LookupRefValidations\validatePositiveInt
static validatePositiveInt($value, bool $allowZero=true)
Definition:
LookupRefValidations.php:29
PhpOffice\PhpSpreadsheet\Calculation\LookupRef\LookupRefValidations
Definition:
LookupRefValidations.php:8
Exception
libs
composer
vendor
phpoffice
phpspreadsheet
src
PhpSpreadsheet
Calculation
LookupRef
LookupRefValidations.php
Generated on Thu Jan 16 2025 19:01:45 for ILIAS by
1.8.13 (using
Doxyfile
)