ILIAS
trunk Revision v12.0_alpha-1540-g00f839d5fa1
◀ ilDoc Overview
PositiveInteger.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
25
namespace
ILIAS\Data
;
26
27
use
ILIAS\Refinery\ConstraintViolationException
;
28
29
class
PositiveInteger
30
{
31
private
int
$value
;
32
36
public
function
__construct
(
int
$value
)
37
{
38
if
(
$value
< 0) {
39
throw
new
ConstraintViolationException
(
40
sprintf(
'The value "%s" is not a positive integer'
,
$value
),
41
'exception_not_positive_integer'
,
42
array(
$value
)
43
);
44
}
45
46
$this->value =
$value
;
47
}
48
49
public
function
getValue
():
int
50
{
51
return
$this->value
;
52
}
53
}
ILIAS\Data\PositiveInteger
Definition:
PositiveInteger.php:30
ILIAS\Data\PositiveInteger\$value
int $value
Definition:
PositiveInteger.php:31
ILIAS\Data\PositiveInteger\getValue
getValue()
Definition:
PositiveInteger.php:49
ILIAS\Data\PositiveInteger\__construct
__construct(int $value)
Definition:
PositiveInteger.php:36
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:30
ILIAS\Data
Definition:
Alphanumeric.php:25
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
components
ILIAS
Data
src
PositiveInteger.php
Generated on Wed Jun 3 2026 23:04:35 for ILIAS by
1.9.4 (using
Doxyfile
)