RedirectController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Router\Controllers;
6
7
final class RedirectController
8
{
9 15
    public function __construct(
10
        private string $destination,
11
        private int $status,
12
    ) {
13 15
    }
14
15 15
    public function __invoke(): string
16
    {
17 15
        header('Location: ' . $this->destination, true, $this->status);
18 15
        return '';
19
    }
20
}
21