Completed
Push — master ( 885f9f...ea2537 )
by Korotkov
10:58 queued 01:29
created

RegistryAdapter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author    : Korotkov Danila <[email protected]>
7
 * @license   https://mit-license.org/ MIT
8
 */
9
10
namespace Structural\Adapter;
11
12
/**
13
 * Class RegistryAdapter
14
 * @package Structural\Adapter
15
 */
16
class RegistryAdapter implements RegistryInterface
17
{
18
19
    /**
20
     * @var AnotherRegistryInterface
21
     */
22
    protected $registry;
23
24
    /**
25
     * RegistryAdapter constructor.
26
     * @param AnotherRegistryInterface $registry
27
     */
28
    public function __construct(AnotherRegistryInterface $registry)
29
    {
30
        $this->registry = $registry;
31
    }
32
33
    /**
34
     * @param string $value
35
     */
36
    public function setFirst(string $value)
37
    {
38
        $this->registry->setItem($value);
39
    }
40
41
    /**
42
     * @param string $value
43
     */
44
    public function setSecond(string $value)
45
    {
46
        $this->registry->setItem($value);
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getFirst(): string
53
    {
54
        return (string) $this->registry->getData()[0];
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getSecond(): string
61
    {
62
        return (string) $this->registry->getData()[1];
63
    }
64
}
65