ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PageReadingTime.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ilException;
24
26{
27 private readonly int $minutes;
28
29 public function __construct(int $minutes)
30 {
31 if ($minutes < 0) {
32 throw new ilException('The reading time MUST be a positive integer!');
33 }
34
35 if ($minutes > PHP_INT_MAX) {
36 throw new ilException('The reading time MUST NOT exceed the maximum integer!');
37 }
38
39 $this->minutes = $minutes;
40 }
41
42 public function minutes(): int
43 {
44 return $this->minutes;
45 }
46}
Base class for ILIAS Exception handling.