QueryException::setQuery()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php namespace AgelxNash\Modx\Evo\Database\Exceptions;
2
3
use Throwable;
4
5
class QueryException extends Exception
6
{
7
    protected $query = '';
8
9
    /**
10
     * @param string $message
11
     * @param int|string $code
12
     * @param Throwable|null $previous
13
     */
14 5
    public function __construct($message = '', $code = 0, Throwable $previous = null)
15
    {
16 5
        parent::__construct($message, (int)$code, $previous);
17
18 5
        $this->code = $code;
19 5
    }
20
21
    /**
22
     * @param string $query
23
     * @return $this
24
     */
25 5
    public function setQuery($query)
26
    {
27 5
        $this->query = $query;
28
29 5
        return $this;
30
    }
31
32
    /**
33
     * @return string
34
     */
35 2
    public function getQuery()
36
    {
37 2
        return $this->query;
38
    }
39
}
40