Passed
Pull Request — master (#1)
by Korotkov
01:44
created

AnotherRegistryAdapter::getSecondValue()   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
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Date: 30.03.18
4
 * Time: 13:04
5
 *
6
 * @author    : Korotkov Danila <[email protected]>
7
 * @copyright Copyright (c) 2018, Korotkov Danila
8
 * @license   http://www.gnu.org/licenses/gpl.html GNU GPLv3.0
9
 */
10
11
namespace Structural\Adapter;
12
13
/**
14
 * Class AnotherRegistryAdapter
15
 * @package Structural\Adapter
16
 */
17
class AnotherRegistryAdapter extends AnotherRegistry implements RegistryInterface
18
{
19
20
    /**
21
     * @var RegistryInterface
22
     */
23
    protected $registry;
24
25
    /**
26
     * @var AnotherRegistryInterface
27
     */
28
    protected $anotherRegistry;
29
30
    /**
31
     * AnotherRegistryAdapter constructor.
32
     * @param RegistryInterface $registry
33
     */
34
    public function __construct(RegistryInterface $registry)
35
    {
36
        $this->registry = $registry;
37
    }
38
39
    public function setFirstValue(string $firstValue)
40
    {
41
        $this->setKey((int)$firstValue);
42
    }
43
44
    public function setSecondValue(string $secondValue)
45
    {
46
        $this->setSlug((int)$secondValue);
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getFirstValue(): string
53
    {
54
        return (string)$this->getKey();
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getSecondValue(): string
61
    {
62
        return (string)$this->getSlug();
63
    }
64
65
    /**
66
     * @param mixed $key
67
     */
68
    protected function setKey($key)
69
    {
70
        $this->key = $key;
71
    }
72
73
    /**
74
     * @param mixed $slug
75
     */
76
    protected function setSlug($slug)
77
    {
78
        $this->slug = $slug;
79
    }
80
}