RedirectView::getVariables()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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