Completed
Push — master ( be3f05...612b7e )
by Marcel
12s
created

Json   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A output() 0 8 2
1
<?php
2
namespace BeyondCode\QueryDetector\Outputs;
3
4
use Illuminate\Support\Collection;
5
use Symfony\Component\HttpFoundation\Response;
6
use Illuminate\Http\JsonResponse;
7
8
class Json implements Output
9
{
10
11
    public function output(Collection $detectedQueries, Response $response)
12
    {
13
        if ($response instanceof JsonResponse) {
14
            $data = $response->getData(true);
15
            $data['warning_queries'] = $detectedQueries;
16
            $response->setData($data);
17
        }
18
    }
19
}
20