QueryString   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A readableSqlQuery() 0 13 3
1
<?php
2
3
namespace NovaExportConfiguration\Helpers;
4
5
class QueryString
6
{
7
    public static function readableSqlQuery($query): string
8
    {
9
        return \Illuminate\Support\Str::replaceArray(
10
            '?',
11
            collect($query->getBindings())
12
                ->map(function ($i) {
13
                    if (is_object($i)) {
14
                        $i = (string) $i;
15
                    }
16
17
                    return (is_string($i)) ? "'$i'" : $i;
18
                })->all(),
19
            $query->toSql()
20
        );
21
    }
22
}
23