ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
PageReadingTime.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ilException;
24 
31 {
32  private readonly int $minutes;
33 
34  public function __construct(int $minutes)
35  {
36  if ($minutes < 0) {
37  throw new ilException('The reading time MUST be a positive integer!');
38  }
39 
40  if ($minutes > PHP_INT_MAX) {
41  throw new ilException('The reading time MUST NOT exceed the maximum integer!');
42  }
43 
44  $this->minutes = $minutes;
45  }
46 
47  public function minutes(): int
48  {
49  return $this->minutes;
50  }
51 }