Code Duplication    Length = 10-10 lines in 4 locations

src/RawResponse.php 4 locations

@@ 54-63 (lines=10) @@
51
        return array_key_exists($name, $this->values);
52
        }
53
54
    public function getValue($name)
55
        {
56
        if(!$this->hasValue($name))
57
            {
58
            $mapsKeys = $this->maps ? implode(', ', array_keys($this->values)) : 'empty array';
59
            throw new \RuntimeException(sprintf('Value %s not found among %s!', $name, $mapsKeys));
60
            }
61
62
        return $this->values[$name];
63
        }
64
65
    public function hasArray($name)
66
        {
@@ 70-79 (lines=10) @@
67
        return array_key_exists($name, $this->arrays);
68
        }
69
70
    public function getArray($name)
71
        {
72
        if(!$this->hasArray($name))
73
            {
74
            $mapsKeys = $this->maps ? implode(', ', array_keys($this->arrays)) : 'empty array';
75
            throw new \RuntimeException(sprintf('Array %s not found among %s!', $name, $mapsKeys));
76
            }
77
78
        return $this->arrays[$name];
79
        }
80
81
    public function hasMap($name)
82
        {
@@ 86-95 (lines=10) @@
83
        return array_key_exists($name, $this->maps);
84
        }
85
86
    public function getMap($name)
87
        {
88
        if(!$this->hasMap($name))
89
            {
90
            $mapsKeys = $this->maps ? implode(', ', array_keys($this->maps)) : 'empty array';
91
            throw new \RuntimeException(sprintf('Map %s not found among %s!', $name, $mapsKeys));
92
            }
93
94
        return $this->maps[$name];
95
        }
96
97
    public function getMapValue($name, $key)
98
        {
@@ 114-123 (lines=10) @@
111
        return array_key_exists($name, $this->tuples);
112
        }
113
114
    public function getTuple($name)
115
        {
116
        if(!$this->hasTuple($name))
117
            {
118
            $tuplesKeys = $this->tuples ? implode(', ', array_keys($this->tuples)) : 'empty array';
119
            throw new \RuntimeException(sprintf('Tuple %s not found among %s!', $name, $tuplesKeys));
120
            }
121
122
        return $this->tuples[$name];
123
        }
124
    }
125