Completed
Push — master ( b7b137...fcca16 )
by Tomasz
02:32
created

LocalClient::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Gendoria\CruftFlake\Local;
4
5
use Gendoria\CruftFlake\ClientInterface;
6
use Gendoria\CruftFlake\Generator\Generator;
7
8
/**
9
 * Local CruftFlake client.
10
 * 
11
 * **WARNING** - it should **NOT** be used in production environment,
12
 * unless each instance is guaranteed to receive unique machine ID.
13
 *
14
 * @author Tomasz Struczyński <[email protected]>
15
 */
16
class LocalClient implements ClientInterface
17
{
18
    /**
19
     * Generator instance.
20
     * 
21
     * @var Generator
22
     */
23
    private $generator;
24
    
25
    /**
26
     * Construct local client class injected with generator instance.
27
     * 
28
     * @param Generator $generator
29
     */
30 2
    function __construct(Generator $generator)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
31
    {
32 2
        $this->generator = $generator;
33 2
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38 2
    public function generateId()
39
    {
40 2
        return $this->generator->generate();
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 1
    public function status()
47
    {
48 1
        return $this->generator->status();
49
    }
50
}
51