GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

BuilderFactory::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php declare (strict_types=1);
2
/**
3
 * @license MIT
4
 * @author Chukwuma Nwali <[email protected]>
5
 */
6
namespace EmmetBlue\Core\Builder;
7
8
/**
9
 * class BuilderFactory..
10
 *
11
 * @author Samuel Adeshina <[email protected]>
12
 * @since 28/05/2016
13
 */
14
class BuilderFactory
15
{
16
    /**
17
     * @var string
18
     */
19
    protected $builder;
20
21
    /**
22
     * @param string $builder
23
     * @param string $builderType
24
     * @throws \Exception
25
     */
26
    public function __construct(string $builder, string $builderType)
27
    {
28
        $builder = __NAMESPACE__."\\$builder\\$builderType$builder";
29
        $builder = new $builder;
30
31
        if (!($builder instanceof BuildableInterface))
32
        {
33
            throw new \Exception();
34
        }
35
36
        $this->builder = $builder;
0 ignored issues
show
Documentation Bug introduced by
It seems like $builder of type object<EmmetBlue\Core\Builder\BuildableInterface> is incompatible with the declared type string of property $builder.

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...
37
    }
38
39
    /**
40
     * Returns a new instance of the requested builder object
41
     *
42
     * @return EmmetBlue\Core\Database\Builder\BuildableInterface
43
     */
44
    public function getBuilder() : BuildableInterface
45
    {
46
        return $this->builder;
47
    }
48
}
49