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

Redirect   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 35
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 4 1
A getVariables() 0 4 1
A file() 0 4 1
A getFile() 0 4 1
A render() 0 4 1
A __construct() 0 4 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