|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Antidot\React\Container; |
|
6
|
|
|
|
|
7
|
|
|
use Antidot\Application\Http\Response\ErrorResponseGenerator; |
|
8
|
|
|
use Antidot\Application\Http\RouteFactory; |
|
9
|
|
|
use Antidot\Application\Http\Router; |
|
10
|
|
|
use Antidot\Application\Http\WebServerApplication; |
|
11
|
|
|
use Antidot\Application\Http\Application; |
|
12
|
|
|
use Antidot\Container\MiddlewareFactory; |
|
13
|
|
|
use Antidot\React\CallablePipeline; |
|
14
|
|
|
use Antidot\React\MiddlewarePipeline; |
|
15
|
|
|
use Antidot\React\Runner\ReactRequestHandlerRunner; |
|
16
|
|
|
use Psr\Container\ContainerInterface; |
|
17
|
|
|
use React\EventLoop\LoopInterface; |
|
18
|
|
|
use React\Socket\ServerInterface; |
|
19
|
|
|
use Zend\HttpHandlerRunner\Emitter\EmitterStack; |
|
|
|
|
|
|
20
|
|
|
use Zend\HttpHandlerRunner\RequestHandlerRunner; |
|
|
|
|
|
|
21
|
|
|
|
|
22
|
|
|
class ApplicationFactory |
|
23
|
|
|
{ |
|
24
|
|
|
public function __invoke(ContainerInterface $container): Application |
|
25
|
|
|
{ |
|
26
|
|
|
$pipeline = new MiddlewarePipeline( |
|
27
|
|
|
$container->get(LoopInterface::class) |
|
28
|
|
|
); |
|
29
|
|
|
return new WebServerApplication( |
|
30
|
|
|
$this->getRunner($container, $pipeline), |
|
31
|
|
|
$pipeline, |
|
32
|
|
|
$container->get(Router::class), |
|
33
|
|
|
$container->get(MiddlewareFactory::class), |
|
34
|
|
|
$container->get(RouteFactory::class) |
|
35
|
|
|
); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
private function getRunner(ContainerInterface $container, CallablePipeline $pipeline): RequestHandlerRunner |
|
39
|
|
|
{ |
|
40
|
|
|
return new ReactRequestHandlerRunner( |
|
41
|
|
|
$pipeline, |
|
42
|
|
|
$container->get(EmitterStack::class), |
|
43
|
|
|
$container->get(ErrorResponseGenerator::class), |
|
44
|
|
|
$container->get(ServerInterface::class), |
|
45
|
|
|
$container->get(LoopInterface::class) |
|
46
|
|
|
); |
|
47
|
|
|
} |
|
48
|
|
|
} |
|
49
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths