PhpReaderContextCreator::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
/**
4
 * This file is part of the sj-i/php-profiler package.
5
 *
6
 * (c) sji <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace PhpProfiler\Inspector\Daemon\Reader\Context;
15
16
use PhpProfiler\Inspector\Daemon\Reader\Controller\PhpReaderController;
17
use PhpProfiler\Inspector\Daemon\Reader\Controller\PhpReaderControllerInterface;
18
use PhpProfiler\Inspector\Daemon\Reader\Controller\PhpReaderControllerProtocol;
19
use PhpProfiler\Inspector\Daemon\Reader\Worker\PhpReaderWorkerProtocol;
20
use PhpProfiler\Inspector\Daemon\Reader\Worker\PhpReaderEntryPoint;
21
use PhpProfiler\Lib\Amphp\ContextCreatorInterface;
22
23
final class PhpReaderContextCreator implements PhpReaderContextCreatorInterface
24
{
25
    public function __construct(
26
        private ContextCreatorInterface $context_creator
27
    ) {
28
    }
29
30
    public function create(): PhpReaderControllerInterface
31
    {
32
        return new PhpReaderController(
33
            $this->context_creator->create(
34
                PhpReaderEntryPoint::class,
35
                PhpReaderWorkerProtocol::class,
36
                PhpReaderControllerProtocol::class
37
            )
38
        );
39
    }
40
}
41