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

QueryException::formatMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

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