QueryTimeoutException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 19
ccs 6
cts 9
cp 0.6667
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPacket() 0 3 1
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PHPTdGram\TdClient\Exception;
6
7
use PHPTdGram\Schema\TdObject;
8
9
/**
10
 * @author  Aurimas Niekis <[email protected]>
11
 */
12
class QueryTimeoutException extends TdClientException
13
{
14
    private TdObject $packet;
15
16 2
    public function __construct(TdObject $packet)
17
    {
18 2
        $this->packet = $packet;
19
20 2
        parent::__construct(
21
            sprintf(
22 2
                'Query for "%s" packet received timeout',
23 2
                $packet->getTdTypeName()
24
            )
25
        );
26 2
    }
27
28
    public function getPacket(): TdObject
29
    {
30
        return $this->packet;
31
    }
32
}
33