MiddlewareHandler   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 4
dl 0
loc 32
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 3 1
A __construct() 0 5 1
A handler() 0 3 1
A middlewarePosition() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of web-stack
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Slick\ModuleApi\Infrastructure\FrontController;
13
14
use Psr\Http\Server\MiddlewareInterface;
15
16
/**
17
 * MiddlewareHandler
18
 *
19
 * @package Slick\WebStack\Infrastructure\FrontController
20
 */
21
class MiddlewareHandler implements MiddlewareHandlerInterface
22
{
23
24
    public function __construct(
25
        protected string $name,
26
        protected MiddlewarePosition $position,
0 ignored issues
show
Bug introduced by
The type Slick\ModuleApi\Infrastr...ller\MiddlewarePosition 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...
27
        protected string|MiddlewareInterface|\Closure $middleware
28
    ) {
29
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function name(): string
35
    {
36
        return $this->name;
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42
    public function middlewarePosition(): MiddlewarePosition
43
    {
44
        return $this->position;
45
    }
46
47
    /**
48
     * @inheritDoc
49
     */
50
    public function handler(): string|callable|MiddlewareInterface
51
    {
52
        return $this->middleware;
53
    }
54
}
55