LocateSourcesViaComposerJson   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Roave\BackwardCompatibility\LocateSources;
6
7
use Roave\BetterReflection\SourceLocator\Ast\Locator;
8
use Roave\BetterReflection\SourceLocator\Type\Composer\Factory\MakeLocatorForComposerJson;
9
use Roave\BetterReflection\SourceLocator\Type\SourceLocator;
10
11
final class LocateSourcesViaComposerJson implements LocateSources
12
{
13
    /** @var Locator */
14
    private $astLocator;
15
16
    public function __construct(Locator $astLocator)
17
    {
18
        $this->astLocator = $astLocator;
19
    }
20
21
    public function __invoke(string $installationPath) : SourceLocator
22
    {
23
        return (new MakeLocatorForComposerJson())
24
            ->__invoke($installationPath, $this->astLocator);
25
    }
26
}
27