ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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 int $minutes;
33 
39  public function __construct(int $minutes)
40  {
41  if ($minutes < 0) {
42  throw new ilException('The reading time MUST be a positive integer!');
43  }
44 
45  if ($minutes > PHP_INT_MAX) {
46  throw new ilException('The reading time MUST NOT exceed the maximum integer!');
47  }
48 
49  $this->minutes = $minutes;
50  }
51 
52  public function minutes(): int
53  {
54  return $this->minutes;
55  }
56 }
__construct(int $minutes)
PageReadingTime constructor.