ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
PageReadingTime.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 /* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
5 
6 use ilException;
7 
13 final class PageReadingTime
14 {
16  private $minutes;
17 
23  public function __construct(int $minutes)
24  {
25  if ($minutes < 0) {
26  throw new ilException('The reading time MUST be a positive integer!');
27  }
28 
29  if ($minutes > PHP_INT_MAX) {
30  throw new ilException('The reading time MUST NOT exceed the maximum integer!');
31  }
32 
33  $this->minutes = $minutes;
34  }
35 
39  public function minutes() : int
40  {
41  return $this->minutes;
42  }
43 }
__construct(int $minutes)
PageReadingTime constructor.