PackageResolverFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 9
rs 10
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Copyright © Vaimo Group. All rights reserved.
4
 * See LICENSE_VAIMO.txt for license details.
5
 */
6
namespace Vaimo\ComposerChangelogs\Factories;
7
8
class PackageResolverFactory
9
{
10
    /**
11
     * @var \Vaimo\ComposerChangelogs\Composer\
12
     */
13
    private $composerCtx;
14
15
    /**
16
     * @param \Vaimo\ComposerChangelogs\Composer\Context $composerCtx
17
     */
18
    public function __construct(
19
        \Vaimo\ComposerChangelogs\Composer\Context $composerCtx
20
    ) {
21
        $this->composerCtx = $composerCtx;
0 ignored issues
show
Documentation Bug introduced by
It seems like $composerCtx of type Vaimo\ComposerChangelogs\Composer\Context is incompatible with the declared type Vaimo\ComposerChangelogs\Composer\ of property $composerCtx.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
22
    }
23
24
    public function create()
25
    {
26
        $packageRepoFactory = new PackageRepositoryFactory($this->composerCtx);
27
28
        $composer = $this->composerCtx->getLocalComposer();
29
        
30
        return new \Vaimo\ComposerChangelogs\Resolvers\PackageResolver(
31
            $packageRepoFactory->create(),
32
            $composer->getPackage()
33
        );
34
    }
35
}
36