QueryException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 33
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setQuery() 0 5 1
A getQuery() 0 3 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