Completed
Push — master ( 692093...daa27a )
by Vitaly
02:57
created

buildFullClassName()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 9
loc 9
ccs 0
cts 4
cp 0
rs 9.6666
c 1
b 0
f 0
cc 3
eloc 4
nc 2
nop 2
crap 12
1
<?php declare(strict_types = 1);
2
/**
3
 * Created by Vitaly Iegorov <[email protected]>.
4
 * on 07.08.16 at 15:46
5
 */
6
namespace samsonframework\container\configurator;
7
8
/**
9
 * Abstract injection configurator.
10
 *
11
 * @author Vitaly Egorov <[email protected]>
12
 */
13
abstract class InjectableAbstractConfigurator
14
{
15
    /** @var string Method argument name */
16
    protected $argumentName;
17
18
    /** @var string Method argument type */
19
    protected $argumentType;
20
21
    /**
22
     * InjectArgument constructor.
23
     *
24
     * @param string $argumentName Injected argument name
25
     * @param string $argumentType Injected argument type hint
26
     *
27
     * @internal param array $valueOrValues
28
     *
29
     */
30
    public function __construct(string $argumentName, string $argumentType)
31
    {
32
        $this->argumentName = $argumentName;
33
        $this->argumentType = $argumentType;
34
    }
35
36
    /**
37
     * Build full class name.
38
     *
39
     * @param string $className Full or short class name
40
     * @param string $namespace Name space
41
     *
42
     * @return string Full class name
43
     */
44 View Code Duplication
    protected function buildFullClassName($className, $namespace)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
45
    {
46
        // Check if we need to append namespace to dependency
47
        if ($className !== null && strpos($className, '\\') === false) {
48
            return $namespace . '\\' . $className;
49
        }
50
51
        return $className;
52
    }
53
}
54