Code Duplication    Length = 11-11 lines in 3 locations

src/Request/AbstractQueryRequest.php 1 location

@@ 58-68 (lines=11) @@
55
     * @param MapperInterface $mapper
56
     * @return Collection
57
     */
58
    public function map(array $result, Context $context = null, MapperInterface $mapper = null)
59
    {
60
        $data = [];
61
        if (!empty($result['results'])) {
62
            $data = $result['results'];
63
        }
64
        if (is_null($mapper)) {
65
            $mapper = JsonObjectMapper::of($context);
66
        }
67
        return $mapper->map($data, $this->resultClass);
68
    }
69
}
70

src/Request/Products/ProductProjectionSearchRequest.php 1 location

@@ 91-101 (lines=11) @@
88
     * @param MapperInterface $mapper
89
     * @return Collection
90
     */
91
    public function map(array $result, Context $context = null, MapperInterface $mapper = null)
92
    {
93
        $data = [];
94
        if (!empty($result['results'])) {
95
            $data = $result['results'];
96
        }
97
        if (is_null($mapper)) {
98
            $mapper = JsonObjectMapper::of($context);
99
        }
100
        return $mapper->map($data, $this->resultClass);
101
    }
102
103
    /**
104
     * @param string $type

src/Request/Products/ProductsSuggestRequest.php 1 location

@@ 171-181 (lines=11) @@
168
     * @param MapperInterface $mapper
169
     * @return Collection
170
     */
171
    public function map(array $result, Context $context = null, MapperInterface $mapper = null)
172
    {
173
        $data = [];
174
        if (!empty($result)) {
175
            $data = $result;
176
        }
177
        if (is_null($mapper)) {
178
            $mapper = JsonObjectMapper::of($context);
179
        }
180
        return $mapper->map($data, $this->resultClass);
181
    }
182
}
183