Passed
Push — master ( 2d6ed9...31b4e9 )
by PHPinnacle
05:04
created

TaskTimeout   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0
ccs 0
cts 8
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A task() 0 3 1
1
<?php
2
/**
3
 * This file is part of PHPinnacle/Ensign.
4
 *
5
 * (c) PHPinnacle Team <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types = 1);
12
13
namespace PHPinnacle\Ensign\Exception;
14
15
final class TaskTimeout extends EnsignException
16
{
17
    /**
18
     * @var int
19
     */
20
    private $task;
21
22
    /**
23
     * @param int $task
24
     */
25
    public function __construct(int $task)
26
    {
27
        $this->task = $task;
28
29
        parent::__construct(sprintf('Task %d timed out.', $task));
30
    }
31
32
    /**
33
     * @return int
34
     */
35
    public function task(): int
36
    {
37
        return $this->task;
38
    }
39
}
40