Completed
Branch erdiko2 (81b309)
by John
02:13
created

Controller::addPhpToJs()   B

Complexity

Conditions 7
Paths 6

Size

Total Lines 16
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 16
rs 8.2222
cc 7
eloc 12
nc 6
nop 2
1
<?php
2
/**
3
 * Controller
4
 * Base request handler, All controllers should be a child this class
5
 * or one of the subclasses (e.g. controllers/Ajax or controllers/Api)
6
 *
7
 * @package     erdiko
8
 * @copyright   2012-2017 Arroyo Labs, Inc. http://www.arroyolabs.com
9
 * @author      John Arroyo <[email protected]>
10
 */
11
namespace erdiko;
12
13
use Interop\Container\ContainerInterface;
14
15
16
class Controller
17
{
18
    protected $container;
19
   
20
    public function __construct(ContainerInterface $container) 
21
    {
22
        $this->container = $container;
23
    }
24
25
    /**
26
     * Redirect to another url
27
     * @param string $url
28
     */
29
    public function redirect($url)
30
    {
31
        header("Location: $url");
32
        exit;
0 ignored issues
show
Coding Style Compatibility introduced by
The method redirect() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
33
    }
34
}