Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php namespace Cornford\Googlmapper; |
||
12 | class Mapper extends MapperBase implements MappingInterface { |
||
13 | |||
14 | /** |
||
15 | * Renders and returns Google Map code. |
||
16 | * |
||
17 | * @param integer $item |
||
18 | * |
||
19 | * @return string |
||
20 | */ |
||
21 | public function render($item = -1) |
||
32 | |||
33 | /** |
||
34 | * Search for a location against Google Maps Api. |
||
35 | * |
||
36 | * @param string $location |
||
37 | * |
||
38 | * @return mixed |
||
39 | */ |
||
40 | protected function searchLocation($location) |
||
47 | |||
48 | /** |
||
49 | * Locate a location and return a Location instance. |
||
50 | * |
||
51 | * @param string $location |
||
52 | * |
||
53 | * @throws MapperArgumentException |
||
54 | * @throws MapperSearchException |
||
55 | * @throws MapperSearchResultException |
||
56 | * @throws MapperException |
||
57 | * |
||
58 | * @return Location |
||
59 | */ |
||
60 | public function location($location) |
||
95 | |||
96 | /** |
||
97 | * Add a new map. |
||
98 | * |
||
99 | * @param float $latitude |
||
100 | * @param float $longitude |
||
101 | * @param array $options |
||
102 | * |
||
103 | * @return self |
||
104 | */ |
||
105 | public function map($latitude, $longitude, array $options = []) |
||
122 | |||
123 | /** |
||
124 | * Add a new street view map. |
||
125 | * |
||
126 | * @param float $latitude |
||
127 | * @param float $longitude |
||
128 | * @param integer $heading |
||
129 | * @param integer $pitch |
||
130 | * @param array $options |
||
131 | * |
||
132 | * @return self |
||
133 | */ |
||
134 | public function streetview($latitude, $longitude, $heading, $pitch, array $options = []) |
||
153 | |||
154 | /** |
||
155 | * Add a new map marker. |
||
156 | * |
||
157 | * @param float $latitude |
||
158 | * @param float $longitude |
||
159 | * @param array $options |
||
160 | * |
||
161 | * @throws MapperException |
||
162 | * |
||
163 | * @return self |
||
164 | */ |
||
165 | public function marker($latitude, $longitude, array $options = []) |
||
180 | |||
181 | /** |
||
182 | * Add a new map information window. |
||
183 | * |
||
184 | * @param float $latitude |
||
185 | * @param float $longitude |
||
186 | * @param string $content |
||
187 | * @param array $options |
||
188 | * |
||
189 | * @throws MapperException |
||
190 | * |
||
191 | * @return self |
||
192 | */ |
||
193 | public function informationWindow($latitude, $longitude, $content, array $options = []) |
||
208 | |||
209 | /** |
||
210 | * Add a new map polyline. |
||
211 | * |
||
212 | * @param array $coordinates |
||
213 | * @param array $options |
||
214 | * |
||
215 | * @throws MapperException |
||
216 | * |
||
217 | * @return self |
||
218 | */ |
||
219 | public function polyline(array $coordinates = [], array $options = []) |
||
243 | |||
244 | /** |
||
245 | * Add a new map polygon. |
||
246 | * |
||
247 | * @param array $coordinates |
||
248 | * @param array $options |
||
249 | * |
||
250 | * @throws MapperException |
||
251 | * |
||
252 | * @return self |
||
253 | */ |
||
254 | View Code Duplication | public function polygon(array $coordinates = [], array $options = []) |
|
279 | |||
280 | /** |
||
281 | * Add a new map rectangle. |
||
282 | * |
||
283 | * @param array $coordinates |
||
284 | * @param array $options |
||
285 | * |
||
286 | * @throws MapperException |
||
287 | * |
||
288 | * @return self |
||
289 | */ |
||
290 | View Code Duplication | public function rectangle(array $coordinates = [], array $options = []) |
|
315 | |||
316 | /** |
||
317 | * Add a new map circle. |
||
318 | * |
||
319 | * @param array $coordinates |
||
320 | * @param array $options |
||
321 | * |
||
322 | * @throws MapperException |
||
323 | * |
||
324 | * @return self |
||
325 | */ |
||
326 | View Code Duplication | public function circle(array $coordinates = [], array $options = []) |
|
352 | |||
353 | } |
||
354 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.