RouteResponse::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 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
}