Passed
Pull Request — master (#196)
by Rustam
02:35
created

Head   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 28
ccs 10
cts 10
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 18 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Router\Attribute;
6
7
use Attribute;
8
use Yiisoft\Http\Method;
9
use Yiisoft\Router\Route;
10
11
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
12
final class Head extends Route
13
{
14
    /**
15
     * @param array<string,scalar|\Stringable|null> $defaults Parameter default values indexed by parameter names.
16
     * @param bool $override Marks route as override. When added it will replace existing route with the same name.
17
     * @param array $disabledMiddlewares Excludes middleware from being invoked when action is handled.
18
     * It is useful to avoid invoking one of the parent group middleware for
19
     * a certain route.
20
     */
21 1
    public function __construct(
22
        string $pattern,
23
        ?string $name = null,
24
        array $middlewares = [],
25
        array $defaults = [],
26
        array $hosts = [],
27
        bool $override = false,
28
        array $disabledMiddlewares = []
29
    ) {
30 1
        parent::__construct(
31 1
            methods: [Method::HEAD],
32 1
            pattern: $pattern,
33 1
            name: $name,
34 1
            middlewares: $middlewares,
35 1
            defaults: $defaults,
36 1
            hosts: $hosts,
37 1
            override: $override,
38 1
            disabledMiddlewares: $disabledMiddlewares
39 1
        );
40
    }
41
}
42