QueryTimeoutException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1.0046

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 8
ccs 5
cts 6
cp 0.8333
crap 1.0046
rs 10
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