PackageResolverFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 9 1
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