ControllerAttribute   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
dl 0
loc 28
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A method() 0 16 1
A methodBefore() 0 3 1
A methodAfter() 0 3 1
1
<?php
2
3
namespace HnrAzevedo\Router\Example\Controllers;
4
5
use HnrAzevedo\Router\Route;
6
7
class ControllerAttribute{
8
9
    #[Route(
10
        uri:'/fooo/{param}',
11
        methods:['GET'],
12
        name:'routeExample',
13
        before:'HnrAzevedo\Router\Example\Controllers\ControllerAttribute@methodBefore',
14
        middleware:[],
15
        attributes:[
16
            'attributeName'=>'attributeValue',
17
            'attributeName0'=>'attributeValue0'
18
        ],
19
        where:[],
20
        after:'HnrAzevedo\Router\Example\Controllers\ControllerAttribute@methodAfter',
21
        )]
22
    public function method($param)
23
    {
24
        echo 'Controller@method executed!'.PHP_EOL."Param:{$param}";
25
    }
26
27
    public function methodBefore(): void
28
    {
29
        echo 'methodBefore'.PHP_EOL;
30
    }
31
32
    public function methodAfter(): void
33
    {
34
        echo PHP_EOL.'methodAfter';
35
    }
36
37
}