AsRoute::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace pjpawel\LightApi\Route;
4
5
use Attribute;
6
7
/**
8
 * Class is to be used as attribute to expose methods as routes to kernel
9
 */
10
#[Attribute(Attribute::TARGET_FUNCTION|Attribute::TARGET_METHOD)]
11
class AsRoute
12
{
13
14
    public string $path;
15
    /**
16
     * @var string[]
17
     */
18
    public array $methods;
19
    //public array $requirements;
20
21
    public function __construct(string $path, array $methods = [])
22
    {
23
        $this->path = $path;
24
        $this->methods = $methods;
25
    }
26
27
}