Passed
Push — next ( 3b41f7...f014dd )
by Bas
02:34
created

QueryException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A formatMessage() 0 6 1
1
<?php
2
3
namespace LaravelFreelancerNL\Aranguent;
4
5
use Illuminate\Database\QueryException as IlluminateQueryException;
6
use Throwable;
7
8
class QueryException extends IlluminateQueryException
9
{
10
    /**
11
     * Format the SQL error message.
12
     *
13
     * @param  string  $sql
14
     * @param  array  $bindings
15
     * @param  \Throwable  $previous
16
     * @return string
17
     */
18 8
    protected function formatMessage($sql, $bindings, Throwable $previous)
19
    {
20 8
        return $previous->getMessage()
21 8
            . ' (AQL: ' . $sql
22 8
            . ' - Bindings: ' . var_export($bindings, true)
23 8
            . ')';
24
    }
25
}
26