ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
PositiveInteger.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25namespace ILIAS\Data;
26
28
30{
31 private int $value;
32
36 public function __construct(int $value)
37 {
38 if ($value < 0) {
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}