QueryTimeoutException::getPacket()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
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