Tracing   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A starting() 0 13 2
1
<?php
2
/**
3
 * HTTP server tracing
4
 * User: moyo
5
 * Date: 2018-11-26
6
 * Time: 14:34
7
 */
8
9
namespace Carno\Web\Components;
10
11
use Carno\Console\Component;
12
use Carno\Console\Contracts\Application;
13
use Carno\Console\Contracts\Bootable;
14
use Carno\Container\DI;
15
use Carno\Traced\Contracts\Observer;
0 ignored issues
show
Bug introduced by
The type Carno\Traced\Contracts\Observer 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...
16
use Carno\Web\Handlers\InboundTracing;
17
use Carno\Web\Handlers\IngressWrapper;
18
use Carno\Web\Server;
19
20
class Tracing extends Component implements Bootable
21
{
22
    /**
23
     * @var array
24
     */
25
    protected $dependencies = [Observer::class];
26
27
    /**
28
     * @param Application $app
29
     */
30
    public function starting(Application $app) : void
31
    {
32
        /**
33
         * @var Observer $platform
34
         */
35
36
        $platform = DI::get(Observer::class);
37
38
        $platform->transportable(static function () {
39
            Server::layers()->has(InboundTracing::class)
40
            || Server::layers()->prepend(IngressWrapper::class, DI::object(InboundTracing::class));
41
        }, static function () {
42
            Server::layers()->remove(InboundTracing::class);
43
        });
44
    }
45
}
46