Passed
Pull Request — master (#9)
by Shinji
01:56
created

PhpReaderContextCreator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 14
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 5 1
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\Lib\Amphp\ContextCreatorInterface;
17
18
final class PhpReaderContextCreator implements PhpReaderContextCreatorInterface
19
{
20
    private ContextCreatorInterface $context_creator;
21
22
    public function __construct(ContextCreatorInterface $context_creator)
23
    {
24
        $this->context_creator = $context_creator;
25
    }
26
27
    public function create(): PhpReaderContextInterface
28
    {
29
        return new PhpReaderContext(
30
            $this->context_creator->create(
31
                PhpReaderEntryPoint::class
32
            )
33
        );
34
    }
35
}
36