Issues (3)

src/App.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace src;
4
5
use src\PeticionInterface;
0 ignored issues
show
The type src\PeticionInterface 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...
6
use src\Middleware;
7
use src\MiddlewareInterface;
8
9
class App
10
{
11
    protected $midleware;
12
13
    public function __construct(Middleware $midleware)
14
    {
15
        $this->midleware = $midleware;
16
    }
17
18
    public function add(array $midlewares)
19
    {
20
        foreach (array_reverse($midlewares) as $midleware) {
21
            $this->do($midleware);
22
        }
23
    }
24
25
    private function do(MiddlewareInterface $midleware)
26
    {
27
        $this->midleware->add($midleware);
28
    }
29
30
    public function run(PeticionInterface $Peticion)
31
    {
32
        $this->midleware->handle($Peticion);
33
    }
34
}
35