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

JsonResponseCreator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 10
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A respond() 0 7 1
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
}