ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
StatisticalValidations.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
PhpOffice\PhpSpreadsheet\Calculation\Statistical
;
4
5
use
PhpOffice\PhpSpreadsheet\Calculation\Exception
;
6
use
PhpOffice\PhpSpreadsheet\Calculation\Functions
;
7
8
class
StatisticalValidations
9
{
13
public
static
function
validateFloat
($value): float
14
{
15
if
(!is_numeric($value)) {
16
throw
new
Exception
(
Functions::VALUE
());
17
}
18
19
return
(
float
) $value;
20
}
21
25
public
static
function
validateInt
($value): int
26
{
27
if
(!is_numeric($value)) {
28
throw
new
Exception
(
Functions::VALUE
());
29
}
30
31
return
(
int
) floor((
float
) $value);
32
}
33
37
public
static
function
validateBool
($value): bool
38
{
39
if
(!is_bool($value) && !is_numeric($value)) {
40
throw
new
Exception
(
Functions::VALUE
());
41
}
42
43
return
(
bool
) $value;
44
}
45
}
PhpOffice\PhpSpreadsheet\Calculation\Statistical\StatisticalValidations
Definition:
StatisticalValidations.php:8
PhpOffice\PhpSpreadsheet\Calculation\Statistical\StatisticalValidations\validateFloat
static validateFloat($value)
Definition:
StatisticalValidations.php:13
Exception
PhpOffice\PhpSpreadsheet\Calculation\Statistical
Definition:
AggregateBase.php:3
PhpOffice\PhpSpreadsheet\Calculation\Statistical\StatisticalValidations\validateInt
static validateInt($value)
Definition:
StatisticalValidations.php:25
Functions
php
PhpOffice\PhpSpreadsheet\Calculation\Functions\VALUE
static VALUE()
VALUE.
Definition:
Functions.php:229
PhpOffice\PhpSpreadsheet\Calculation\Statistical\StatisticalValidations\validateBool
static validateBool($value)
Definition:
StatisticalValidations.php:37
Exception
libs
composer
vendor
phpoffice
phpspreadsheet
src
PhpSpreadsheet
Calculation
Statistical
StatisticalValidations.php
Generated on Thu Jan 16 2025 19:01:46 for ILIAS by
1.8.13 (using
Doxyfile
)