Code Duplication    Length = 10-16 lines in 3 locations

src/Schema.php 3 locations

@@ 121-136 (lines=16) @@
118
     *
119
     * @return string[]
120
     */
121
    public function getSupportedSchemes($template, $method)
122
    {
123
        $schemes = $this->fetch(
124
            $this->schema,
125
            'paths',
126
            $template,
127
            $method,
128
            'schemes'
129
        );
130
131
        if (!$schemes) {
132
            $schemes = $this->fetch($this->schema, 'schemes');
133
        }
134
135
        return (array) $schemes;
136
    }
137
138
    /**
139
     * @param string $template
@@ 205-214 (lines=10) @@
202
     *
203
     * @return string[]
204
     */
205
    public function getRequestContentTypes($template, $method)
206
    {
207
        $items = $this->fetch($this->schema, 'paths', $template, $method, 'consumes');
208
209
        if (!$items) {
210
            $items = $this->fetch($this->schema, 'consumes');
211
        }
212
213
        return (array) $items;
214
    }
215
216
    /**
217
     * @param string $template
@@ 239-248 (lines=10) @@
236
     *
237
     * @return string[]
238
     */
239
    public function getResponseContentTypes($template, $method)
240
    {
241
        $items = $this->fetch($this->schema, 'paths', $template, $method, 'produces');
242
243
        if (!$items) {
244
            $items = $this->fetch($this->schema, 'produces');
245
        }
246
247
        return (array) $items;
248
    }
249
250
    /**
251
     * @param string $template