BaseJsonResponse   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A toResponse() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: leo108
5
 * Date: 2016/10/25
6
 * Time: 15:16
7
 */
8
9
namespace Leo108\CAS\Responses;
10
11
use Symfony\Component\HttpFoundation\Response;
12
13
class BaseJsonResponse
14
{
15
    /**
16
     * @var array
17
     */
18
    protected $data;
19
20
    /**
21
     * @return Response
22
     */
23 1
    public function toResponse()
24
    {
25 1
        return new Response(json_encode($this->data), 200, ['Content-Type' => 'application/json']);
26
    }
27
}
28