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

TimeoutException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 15
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTimeout() 0 3 1
A getSpentTime() 0 3 1
A __construct() 0 3 1
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