Code Duplication    Length = 14-14 lines in 3 locations

src/Generation/Handler/RequestBodyHandler.php 1 location

@@ 56-69 (lines=14) @@
53
     *
54
     * @return null
55
     */
56
    private function setBodyParts()
57
    {
58
        if (!$this->annotations->exists(Part::NAME)) {
59
            return null;
60
        }
61
62
        $parts = [];
63
        /** @var Part $partAnnotation */
64
        foreach ($this->annotations->get(Part::NAME) as $partAnnotation) {
65
            $parts[$partAnnotation->getRequestKey()] = $partAnnotation->getVariable();
66
        }
67
68
        $this->methodBodyBuilder->setBodyParts($parts);
69
    }
70
}
71

src/Generation/Handler/RequestUrlHandler.php 1 location

@@ 38-51 (lines=14) @@
35
     *
36
     * @param HttpRequest $requestAnnotation
37
     */
38
    private function setQueries(HttpRequest $requestAnnotation)
39
    {
40
        $queries = $requestAnnotation->getQueries();
41
42
        if ($this->annotations->exists(Query::NAME)) {
43
            /** @var Query $queryAnnotation */
44
            foreach ($this->annotations->get(Query::NAME) as $queryAnnotation) {
45
                $queries[$queryAnnotation->getRequestKey()] = $queryAnnotation->getVariable();
46
            }
47
48
        }
49
50
        $this->methodBodyBuilder->setQueries($queries);
51
    }
52
53
    /**
54
     * Set query map if annotation exists

src/Generation/Handler/RequestHeaderHandler.php 1 location

@@ 41-54 (lines=14) @@
38
     * @param array $headers
39
     * @return array
40
     */
41
    private function setHeaders(array $headers)
42
    {
43
        if (!$this->annotations->exists(Header::NAME)) {
44
45
            return $headers;
46
        }
47
48
        /** @var Header $headerAnnotation */
49
        foreach ($this->annotations->get(Header::NAME) as $headerAnnotation) {
50
            $headers[$headerAnnotation->getRequestKey()] = $headerAnnotation->getVariable();
51
        }
52
53
        return $headers;
54
    }
55
56
    /**
57
     * Set request headers from list if annotation exists