Completed
Push — master ( 9efb49...7ad915 )
by Park Jong-Hun
03:23
created

Redirect::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace App\ViewEngine;
4
5
use Core\ViewEngineInterface;
6
7
class Redirect implements ViewEngineInterface
8
{
9
10
    private $url = '';
11
12
    public function __construct($settings = [])
13
    {
14
        // dummy
15
    }
16
17
    public function set($key, $value)
18
    {
19
        // dummy
20
    }
21
22
    public function getVariables()
23
    {
24
        return [];
25
    }
26
27
    public function file($url)
28
    {
29
        $this->url = $url;
30
    }
31
32
    public function getFile()
33
    {
34
        return $this->url;
35
    }
36
37
    public function render()
38
    {
39
        header('location: ' . $this->url);
40
    }
41
}
42