Test Failed
Push — master ( 492ea4...9c8472 )
by Bingo
04:47
created

Supplier   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get() 0 3 1
1
<?php
2
3
namespace Graphp\Util;
4
5
/**
6
 * Class Supplier
7
 *
8
 * @package Graphp\Util
9
 */
10
class Supplier implements SupplierInterface
11
{
12
    /**
13
     * Name of the class, whose instance will be provided
14
     *
15
     * @var string
16
     */
17
    private $className;
18
19
    /**
20
     * Construct a new supplier
21
     *
22
     * @param string $className - the class name
23
     */
24 36
    public function __construct(string $className)
25
    {
26 36
        $this->className = $className;
27 36
    }
28
29
    /**
30
     * Get the specified class instance
31
     *
32
     * @return mixed
33
     */
34 25
    public function get()
35
    {
36 25
        return new $this->className();
37
    }
38
}
39