ILIAS
release_8 Revision v8.23
◀ ilDoc Overview
PositiveInteger.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
6
11
namespace
ILIAS\Data
;
12
13
use
ILIAS\Refinery\ConstraintViolationException
;
14
15
class
PositiveInteger
16
{
17
private
int
$value
;
18
22
public
function
__construct
(
int
$value)
23
{
24
if
($value < 0) {
25
throw
new
ConstraintViolationException
(
26
sprintf(
'The value "%s" is not a positive integer'
, $value),
27
'exception_not_positive_integer'
,
28
array($value)
29
);
30
}
31
32
$this->value =
$value
;
33
}
34
35
public
function
getValue
():
int
36
{
37
return
$this->value
;
38
}
39
}
ILIAS\Data\PositiveInteger\getValue
getValue()
Definition:
PositiveInteger.php:35
ILIAS\Data\PositiveInteger
Definition:
PositiveInteger.php:15
ILIAS\Data\PositiveInteger\__construct
__construct(int $value)
Definition:
PositiveInteger.php:22
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:29
ILIAS\Data\PositiveInteger\$value
int $value
Definition:
PositiveInteger.php:17
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
ConstraintViolationException
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS\Data
Definition:
Alphanumeric.php:11
src
Data
PositiveInteger.php
Generated on Wed Sep 3 2025 22:02:53 for ILIAS by
1.8.13 (using
Doxyfile
)