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

QueryException::formatMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
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