RouteResponse   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 36
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
A render() 0 4 1
1
<?php
2
3
namespace Preetender\Routing;
4
5
use Preetender\Routing\Contracts\Renderable;
6
7
/**
8
 * Class RouteResponse
9
 * @package Preetender\Routing
10
 */
11
final class RouteResponse implements Renderable
12
{
13
    /** @var */
14
    protected $data;
15
16
    /**
17
     * RouteResponse constructor.
18
     *
19
     * @param null $data
20
     */
21
    public function __construct($data = null)
22
    {
23
        $this->data = $data;
24
    }
25
26
    /**
27
     * Create static instance
28
     *
29
     * @param $data
30
     * @return static
31
     */
32
    public static function create($data)
33
    {
34
        return new static($data);
35
    }
36
37
    /**
38
     * Format and return to requester
39
     *
40
     * @return mixed
41
     */
42
    public function render()
43
    {
44
        return $this->data;
45
    }
46
}