ILIAS  release_8 Revision v8.24
PositiveInteger.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
6
11namespace ILIAS\Data;
12
14
16{
17 private int $value;
18
22 public function __construct(int $value)
23 {
24 if ($value < 0) {
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}