Code Duplication    Length = 16-16 lines in 2 locations

src/Generation/Provider/AnnotationProvider.php 2 locations

@@ 148-163 (lines=16) @@
145
     *
146
     * @return array|null
147
     */
148
    public function getHeaders()
149
    {
150
        if (!$this->annotations->exists(Header::NAME)) {
151
            return null;
152
        }
153
154
        /** @var Header[] $headerAnnotations */
155
        $headerAnnotations = $this->annotations->get(Header::NAME) ;
156
157
        $headers = [];
158
        foreach ($headerAnnotations as $headerAnnotation) {
159
            $headers[$headerAnnotation->getRequestKey()] = $headerAnnotation->getVariable();
160
        }
161
162
        return $headers;
163
    }
164
165
    /**
166
     * Get headers defined by "@Headers"
@@ 287-302 (lines=16) @@
284
     *
285
     * @return array|null
286
     */
287
    public function getBodyParts()
288
    {
289
        if (!$this->annotations->exists(Part::NAME)) {
290
            return null;
291
        }
292
293
        /** @var Part[] $partAnnotations */
294
        $partAnnotations = $this->annotations->get(Part::NAME);
295
296
        $parts = [];
297
        foreach ($partAnnotations as $partAnnotation) {
298
            $parts[$partAnnotation->getRequestKey()] = $partAnnotation->getVariable();
299
        }
300
301
        return $parts;
302
    }
303
304
    /**
305
     * If the body parameter is an object