Passed
Push — master ( 020179...2cb551 )
by Doug
11:37
created

TimeoutException::getTimeout()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * Box packing (3D bin packing, knapsack problem).
5
 *
6
 * @author Doug Wright
7
 */
8
declare(strict_types=1);
9
10
namespace DVDoug\BoxPacker\Exception;
11
12
use RuntimeException;
13
14
/**
15
 * Exception used when the timeout occurred.
16
 */
17
class TimeoutException extends RuntimeException
18
{
19
    public function __construct(string $message, private readonly float $spentTime, private readonly float $timeout)
20
    {
21
        parent::__construct($message);
22
    }
23
24
    public function getTimeout(): float
25
    {
26
        return $this->timeout;
27
    }
28
29
    public function getSpentTime(): float
30
    {
31
        return $this->spentTime;
32
    }
33
}
34