ILIAS  release_7 Revision v7.30-3-g800a261c036
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
7
13final 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}
An exception for terminatinating execution or to throw for unit testing.
__construct(int $minutes)
PageReadingTime constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...