Passed
Push — master ( 92e76a...1cfcdd )
by Robson
02:02
created

Name   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A home() 0 6 1
A hello() 0 3 1
A redirect() 0 3 1
1
<?php
2
3
namespace Test;
4
5
class Name
6
{
7
    public function __construct($router)
8
    {
9
        $this->router = $router;
0 ignored issues
show
Bug Best Practice introduced by
The property router does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
10
    }
11
12
    public function home(): void
13
    {
14
        echo "<h1>Home</h1>";
15
        echo "<p>", $this->router->route("name.home"), "</p>";
16
        echo "<p>", $this->router->route("name.hello"), "</p>";
17
        echo "<p>", $this->router->route("name.redirect"), "</p>";
18
    }
19
20
    public function hello(): void
21
    {
22
        echo "<h1>Hello World</h1>";
23
    }
24
25
    public function redirect(): void
26
    {
27
        $this->router->redirect("name.hello");
28
    }
29
}