RedirectView   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
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 34
rs 10

6 Methods

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