Failed Conditions
Push — refactor/improve-static-analys... ( d71351...8065ea )
by Bas
05:41
created

QueryException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 1

1 Method

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