Passed
Push — master ( ec5386...e56f88 )
by Andrey
53s queued 14s
created

HomeController::index()   A

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
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Endpoint\Web;
6
7
use Exception;
8
use Spiral\Prototype\Traits\PrototypeTrait;
0 ignored issues
show
Bug introduced by
The type Spiral\Prototype\Traits\PrototypeTrait was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Spiral\Router\Annotation\Route;
0 ignored issues
show
Bug introduced by
The type Spiral\Router\Annotation\Route was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
/**
12
 * Simple home page controller. It renders home page template and also provides
13
 * an example of exception page.
14
 */
15
final class HomeController
16
{
17
    /**
18
     * Read more about Prototyping:
19
     * @link https://spiral.dev/docs/basics-prototype/#installation
20
     */
21
    use PrototypeTrait;
22
23
24
    #[Route(route: '/', name: 'index')]
25
    public function index(): string
26
    {
27
        return $this->views->render('home');
28
    }
29
30
    /**
31
     * Example of exception page.
32
     */
33
    #[Route(route: '/exception', name: 'exception')]
34
    public function exception(): never
35
    {
36
        throw new Exception('This is a test exception.');
37
    }
38
}
39