Conditions | 1 |
Paths | 1 |
Total Lines | 120 |
Code Lines | 2 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
199 | private function getLastPageJson() |
||
200 | { |
||
201 | return '{ |
||
202 | "html_attributions" : [], |
||
203 | "results" : [ |
||
204 | { |
||
205 | "geometry" : { |
||
206 | "location" : { |
||
207 | "lat" : -33.870775, |
||
208 | "lng" : 151.199025 |
||
209 | } |
||
210 | }, |
||
211 | "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/travel_agent-71.png", |
||
212 | "id" : "foobar", |
||
213 | "name" : "Rhythmboat Cruises", |
||
214 | "opening_hours" : { |
||
215 | "open_now" : true |
||
216 | }, |
||
217 | "photos" : [ |
||
218 | { |
||
219 | "height" : 270, |
||
220 | "html_attributions" : [], |
||
221 | "photo_reference" : "CnRnAAAAF-LjFR1ZV93eawe1cU_3QNMCNmaGkowY7CnOf-kcNmPhNnPEG9W979jOuJJ1sGr75rhD5hqKzjD8vbMbSsRnq_Ni3ZIGfY6hKWmsOf3qHKJInkm4h55lzvLAXJVc-Rr4kI9O1tmIblblUpg2oqoq8RIQRMQJhFsTr5s9haxQ07EQHxoUO0ICubVFGYfJiMUPor1GnIWb5i8", |
||
222 | "width" : 519 |
||
223 | } |
||
224 | ], |
||
225 | "place_id" : "ChIJyWEHuEmuEmsRm9hTkapTCrk", |
||
226 | "scope" : "GOOGLE", |
||
227 | "alt_ids" : [ |
||
228 | { |
||
229 | "place_id" : "D9iJyWEHuEmuEmsRm9hTkapTCrk", |
||
230 | "scope" : "APP" |
||
231 | } |
||
232 | ], |
||
233 | "reference" : "CoQBdQAAAFSiijw5-cAV68xdf2O18pKIZ0seJh03u9h9wk_lEdG-cP1dWvp_QGS4SNCBMk_fB06YRsfMrNkINtPez22p5lRIlj5ty_HmcNwcl6GZXbD2RdXsVfLYlQwnZQcnu7ihkjZp_2gk1-fWXql3GQ8-1BEGwgCxG-eaSnIJIBPuIpihEhAY1WYdxPvOWsPnb2-nGb6QGhTipN0lgaLpQTnkcMeAIEvCsSa0Ww", |
||
234 | "types" : [ "travel_agency", "restaurant", "food", "establishment" ], |
||
235 | "vicinity" : "Pyrmont Bay Wharf Darling Dr, Sydney" |
||
236 | }, |
||
237 | { |
||
238 | "geometry" : { |
||
239 | "location" : { |
||
240 | "lat" : -33.866891, |
||
241 | "lng" : 151.200814 |
||
242 | } |
||
243 | }, |
||
244 | "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png", |
||
245 | "id" : "45a27fd8d56c56dc62afc9b49e1d850440d5c403", |
||
246 | "name" : "Private Charter Sydney Habour Cruise", |
||
247 | "photos" : [ |
||
248 | { |
||
249 | "height" : 426, |
||
250 | "html_attributions" : [], |
||
251 | "photo_reference" : "CnRnAAAAL3n0Zu3U6fseyPl8URGKD49aGB2Wka7CKDZfamoGX2ZTLMBYgTUshjr-MXc0_O2BbvlUAZWtQTBHUVZ-5Sxb1-P-VX2Fx0sZF87q-9vUt19VDwQQmAX_mjQe7UWmU5lJGCOXSgxp2fu1b5VR_PF31RIQTKZLfqm8TA1eynnN4M1XShoU8adzJCcOWK0er14h8SqOIDZctvU", |
||
252 | "width" : 640 |
||
253 | } |
||
254 | ], |
||
255 | "place_id" : "ChIJqwS6fjiuEmsRJAMiOY9MSms", |
||
256 | "scope" : "GOOGLE", |
||
257 | "reference" : "CpQBhgAAAFN27qR_t5oSDKPUzjQIeQa3lrRpFTm5alW3ZYbMFm8k10ETbISfK9S1nwcJVfrP-bjra7NSPuhaRulxoonSPQklDyB-xGvcJncq6qDXIUQ3hlI-bx4AxYckAOX74LkupHq7bcaREgrSBE-U6GbA1C3U7I-HnweO4IPtztSEcgW09y03v1hgHzL8xSDElmkQtRIQzLbyBfj3e0FhJzABXjM2QBoUE2EnL-DzWrzpgmMEulUBLGrtu2Y", |
||
258 | "types" : [ "restaurant", "food", "establishment" ], |
||
259 | "vicinity" : "Australia" |
||
260 | }, |
||
261 | { |
||
262 | "geometry" : { |
||
263 | "location" : { |
||
264 | "lat" : -33.870943, |
||
265 | "lng" : 151.190311 |
||
266 | } |
||
267 | }, |
||
268 | "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png", |
||
269 | "id" : "30bee58f819b6c47bd24151802f25ecf11df8943", |
||
270 | "name" : "Bucks Party Cruise", |
||
271 | "opening_hours" : { |
||
272 | "open_now" : true |
||
273 | }, |
||
274 | "photos" : [ |
||
275 | { |
||
276 | "height" : 600, |
||
277 | "html_attributions" : [], |
||
278 | "photo_reference" : "CnRnAAAA48AX5MsHIMiuipON_Lgh97hPiYDFkxx_vnaZQMOcvcQwYN92o33t5RwjRpOue5R47AjfMltntoz71hto40zqo7vFyxhDuuqhAChKGRQ5mdO5jv5CKWlzi182PICiOb37PiBtiFt7lSLe1SedoyrD-xIQD8xqSOaejWejYHCN4Ye2XBoUT3q2IXJQpMkmffJiBNftv8QSwF4", |
||
279 | "width" : 800 |
||
280 | } |
||
281 | ], |
||
282 | "place_id" : "ChIJLfySpTOuEmsRsc_JfJtljdc", |
||
283 | "scope" : "GOOGLE", |
||
284 | "reference" : "CoQBdQAAANQSThnTekt-UokiTiX3oUFT6YDfdQJIG0ljlQnkLfWefcKmjxax0xmUpWjmpWdOsScl9zSyBNImmrTO9AE9DnWTdQ2hY7n-OOU4UgCfX7U0TE1Vf7jyODRISbK-u86TBJij0b2i7oUWq2bGr0cQSj8CV97U5q8SJR3AFDYi3ogqEhCMXjNLR1k8fiXTkG2BxGJmGhTqwE8C4grdjvJ0w5UsAVoOH7v8HQ", |
||
285 | "types" : [ "restaurant", "food", "establishment" ], |
||
286 | "vicinity" : "37 Bank St, Pyrmont" |
||
287 | }, |
||
288 | { |
||
289 | "geometry" : { |
||
290 | "location" : { |
||
291 | "lat" : -33.867591, |
||
292 | "lng" : 151.201196 |
||
293 | } |
||
294 | }, |
||
295 | "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/travel_agent-71.png", |
||
296 | "id" : "a97f9fb468bcd26b68a23072a55af82d4b325e0d", |
||
297 | "name" : "Australian Cruise Group", |
||
298 | "opening_hours" : { |
||
299 | "open_now" : true |
||
300 | }, |
||
301 | "photos" : [ |
||
302 | { |
||
303 | "height" : 242, |
||
304 | "html_attributions" : [], |
||
305 | "photo_reference" : "CnRnAAAABjeoPQ7NUU3pDitV4Vs0BgP1FLhf_iCgStUZUr4ZuNqQnc5k43jbvjKC2hTGM8SrmdJYyOyxRO3D2yutoJwVC4Vp_dzckkjG35L6LfMm5sjrOr6uyOtr2PNCp1xQylx6vhdcpW8yZjBZCvVsjNajLBIQ-z4ttAMIc8EjEZV7LsoFgRoU6OrqxvKCnkJGb9F16W57iIV4LuM", |
||
306 | "width" : 200 |
||
307 | } |
||
308 | ], |
||
309 | "place_id" : "ChIJrTLr-GyuEmsRBfy61i59si0", |
||
310 | "scope" : "GOOGLE", |
||
311 | "reference" : "CoQBeQAAAFvf12y8veSQMdIMmAXQmus1zqkgKQ-O2KEX0Kr47rIRTy6HNsyosVl0CjvEBulIu_cujrSOgICdcxNioFDHtAxXBhqeR-8xXtm52Bp0lVwnO3LzLFY3jeo8WrsyIwNE1kQlGuWA4xklpOknHJuRXSQJVheRlYijOHSgsBQ35mOcEhC5IpbpqCMe82yR136087wZGhSziPEbooYkHLn9e5njOTuBprcfVw", |
||
312 | "types" : [ "travel_agency", "restaurant", "food", "establishment" ], |
||
313 | "vicinity" : "32 The Promenade, King Street Wharf 5, Sydney" |
||
314 | } |
||
315 | ], |
||
316 | "status" : "OK" |
||
317 | }'; |
||
318 | } |
||
319 | } |
||
320 |