Passed
Push — master ( 7c6c7d...e6ca4a )
by Korotkov
02:20
created

Adapter::getRegistry()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
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
final class Adapter implements RegistryInterface
17
{
18
    /**
19
     * @var AnotherRegistryInterface
20
     */
21
    private $registry;
22
23
    /**
24
     * RegistryAdapter constructor.
25
     * @param AnotherRegistryInterface $registry
26
     */
27
    public function __construct(AnotherRegistryInterface $registry)
28
    {
29
        $this->registry = $registry;
30
    }
31
32
    /**
33
     * @param string $value
34
     */
35
    public function setFirst(string $value)
36
    {
37
        $this->getRegistry()->setData($value);
38
    }
39
40
    /**
41
     * @param string $value
42
     */
43
    public function setSecond(string $value)
44
    {
45
        $this->getRegistry()->setData($value);
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getFirst(): string
52
    {
53
        return (string) $this->getRegistry()->getData()[0];
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getSecond(): string
60
    {
61
        return (string) $this->getRegistry()->getData()[1];
62
    }
63
64
    /**
65
     * @return AnotherRegistryInterface
66
     */
67
    public function getRegistry(): AnotherRegistryInterface
68
    {
69
        return $this->registry;
70
    }
71
}
72