Completed
Pull Request — master (#2)
by claudio
03:56
created

JsonResponseCreator::respond()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4286
cc 1
eloc 4
nc 1
nop 2
crap 2
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: miha
6
 * Date: 18.11.15.
7
 * Time: 19:45
8
 */
9
10
namespace Services\ResponseCreator;
0 ignored issues
show
Coding Style introduced by
There must be one blank line after the namespace declaration
Loading history...
11
12
13
class JsonResponseCreator implements ResponseCreator
14
{
15
    public function respond($data, $code)
16
    {
17
        return response()->toJson(
0 ignored issues
show
Bug introduced by
The method toJson() does not seem to exist on object<Illuminate\Contra...outing\ResponseFactory>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
18
            $data,
19
            $code
20
        );
21
    }
22
}