Passed
Push — master ( f6df85...456d77 )
by Korotkov
03:12 queued 01:32
created

Adapter::getSecond()   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  : Jagepard <[email protected]>
7
 * @license https://mit-license.org/ MIT
8
 */
9
10
namespace Structural\Adapter;
11
12
final class Adapter implements RegistryInterface
13
{
14
    private AnotherRegistryInterface $registry;
15
16
    /**
17
     * Sets a different registry type
18
     * ------------------------------
19
     * Устанавливает другой тип реестра
20
     *
21
     * @param  AnotherRegistryInterface $registry
22
     */
23
    public function __construct(AnotherRegistryInterface $registry)
24
    {
25
        $this->registry = $registry;
26
    }
27
28
    /**
29
     * Sets the first value
30
     * --------------------
31
     * Устанавливает первое значение
32
     *
33
     * @param  string $value
34
     * @return void
35
     */
36
    public function setFirst(string $value)
37
    {
38
        $this->registry->setData($value);
39
    }
40
41
    /**
42
     * Sets the second value
43
     * ---------------------
44
     * Устанавливает второе значение
45
     *
46
     * @param  string $value
47
     * @return void
48
     */
49
    public function setSecond(string $value)
50
    {
51
        $this->registry->setData($value);
52
    }
53
54
    /**
55
     * Gets the first value
56
     * --------------------
57
     * Получает первое значение
58
     *
59
     * @return string
60
     */
61
    public function getFirst(): string
62
    {
63
        return (string) $this->registry->getData()[0];
64
    }
65
66
    /**
67
     * Gets the second value
68
     * ---------------------
69
     * Получает второе значение
70
     *
71
     * @return string
72
     */
73
    public function getSecond(): string
74
    {
75
        return (string) $this->registry->getData()[1];
76
    }
77
}
78