Completed
Push — master ( 3c8880...e2c218 )
by Dmitry
06:42 queued 02:46
created

RenderJsonAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 5 2
1
<?php
2
3
/*
4
 * HiPanel core package
5
 *
6
 * @link      https://hipanel.com/
7
 * @package   hipanel-core
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\actions;
13
14
/**
15
 * Class RenderJsonAction.
16
 */
17
class RenderJsonAction extends Action
18
{
19
    /**
20
     * @var callback|array view to render.
21
     */
22
    public $return;
23
24
    public function run()
25
    {
26
        $data = $this->return instanceof \Closure ? call_user_func($this->return, $this) : $this->return;
27
        return $this->controller->renderJson($data);
28
    }
29
}
30