HandlerException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 10
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getQuery() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of Cycle ORM package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\Database\Exception;
13
14
/**
15
 * Schema sync related exception.
16
 */
17
class HandlerException extends DriverException implements StatementExceptionInterface
18
{
19
    public function __construct(StatementException $e)
20
    {
21
        parent::__construct($e->getMessage(), (int) $e->getCode(), $e);
22 10
    }
23
24 10
    public function getQuery(): string
25 10
    {
26
        return $this->getPrevious()->getQuery();
0 ignored issues
show
Bug introduced by
The method getQuery() does not exist on Exception. It seems like you code against a sub-type of Exception such as Cycle\Database\Exception\HandlerException or Cycle\Database\Exception\StatementException. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
        return $this->getPrevious()->/** @scrutinizer ignore-call */ getQuery();
Loading history...
27
    }
28
}
29