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

RegistryAdapter   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 47
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setFirst() 0 3 1
A __construct() 0 3 1
A setSecond() 0 3 1
A getSecond() 0 3 1
A getFirst() 0 3 1
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