Complex classes like Service often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Service, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
20 | class Service extends AbstractSoapClientBase |
||
21 | { |
||
22 | /** |
||
23 | * Method to call the operation originally named addShipment |
||
24 | * Meta informations extracted from the WSDL |
||
25 | * - documentation: Create Shipment and get Smsa AWB Number |
||
26 | * |
||
27 | * @uses AbstractSoapClientBase::getSoapClient() |
||
28 | * @uses AbstractSoapClientBase::setResult() |
||
29 | * @uses AbstractSoapClientBase::getResult() |
||
30 | * @uses AbstractSoapClientBase::saveLastError() |
||
31 | * |
||
32 | * @param \Alhoqbani\SmsaWebService\Soap\Type\AddShipment $parameters |
||
33 | * |
||
34 | * @return \Alhoqbani\SmsaWebService\Soap\Type\AddShipmentResponse|bool |
||
35 | */ |
||
36 | public function addShipment(\Alhoqbani\SmsaWebService\Soap\Type\AddShipment $parameters) |
||
48 | |||
49 | /** |
||
50 | * Method to call the operation originally named addShip |
||
51 | * Meta informations extracted from the WSDL |
||
52 | * - documentation: Create Shipment with Shipper Details and get Smsa AWB Number |
||
53 | * |
||
54 | * @uses AbstractSoapClientBase::getSoapClient() |
||
55 | * @uses AbstractSoapClientBase::setResult() |
||
56 | * @uses AbstractSoapClientBase::getResult() |
||
57 | * @uses AbstractSoapClientBase::saveLastError() |
||
58 | * |
||
59 | * @param \Alhoqbani\SmsaWebService\Soap\Type\AddShip $parameters |
||
60 | * |
||
61 | * @return \Alhoqbani\SmsaWebService\Soap\Type\AddShipResponse|bool |
||
62 | */ |
||
63 | public function addShip(\Alhoqbani\SmsaWebService\Soap\Type\AddShip $parameters) |
||
75 | |||
76 | /** |
||
77 | * Method to call the operation originally named addShipMPS |
||
78 | * Meta informations extracted from the WSDL |
||
79 | * - documentation: Create Shipment with Shipper Details and get Smsa AWB Number for Multi piece Shipments |
||
80 | * |
||
81 | * @uses AbstractSoapClientBase::getSoapClient() |
||
82 | * @uses AbstractSoapClientBase::setResult() |
||
83 | * @uses AbstractSoapClientBase::getResult() |
||
84 | * @uses AbstractSoapClientBase::saveLastError() |
||
85 | * |
||
86 | * @param \Alhoqbani\SmsaWebService\Soap\Type\AddShipMPS $parameters |
||
87 | * |
||
88 | * @return \Alhoqbani\SmsaWebService\Soap\Type\AddShipMPSResponse|bool |
||
89 | */ |
||
90 | public function addShipMPS(\Alhoqbani\SmsaWebService\Soap\Type\AddShipMPS $parameters) |
||
102 | |||
103 | /** |
||
104 | * Method to call the operation originally named stoShipment |
||
105 | * Meta informations extracted from the WSDL |
||
106 | * - documentation: Ship to Origin after Delivery |
||
107 | * |
||
108 | * @uses AbstractSoapClientBase::getSoapClient() |
||
109 | * @uses AbstractSoapClientBase::setResult() |
||
110 | * @uses AbstractSoapClientBase::getResult() |
||
111 | * @uses AbstractSoapClientBase::saveLastError() |
||
112 | * |
||
113 | * @param \Alhoqbani\SmsaWebService\Soap\Type\StoShipment $parameters |
||
114 | * |
||
115 | * @return \Alhoqbani\SmsaWebService\Soap\Type\StoShipmentResponse|bool |
||
116 | */ |
||
117 | public function stoShipment(\Alhoqbani\SmsaWebService\Soap\Type\StoShipment $parameters) |
||
129 | |||
130 | /** |
||
131 | * Method to call the operation originally named addShipmentDelv |
||
132 | * Meta informations extracted from the WSDL |
||
133 | * - documentation: Create Shipment with Delivery Details and get Smsa AWB Number |
||
134 | * |
||
135 | * @uses AbstractSoapClientBase::getSoapClient() |
||
136 | * @uses AbstractSoapClientBase::setResult() |
||
137 | * @uses AbstractSoapClientBase::getResult() |
||
138 | * @uses AbstractSoapClientBase::saveLastError() |
||
139 | * |
||
140 | * @param \Alhoqbani\SmsaWebService\Soap\Type\AddShipmentDelv $parameters |
||
141 | * |
||
142 | * @return \Alhoqbani\SmsaWebService\Soap\Type\AddShipmentDelvResponse|bool |
||
143 | */ |
||
144 | public function addShipmentDelv(\Alhoqbani\SmsaWebService\Soap\Type\AddShipmentDelv $parameters) |
||
156 | |||
157 | /** |
||
158 | * Method to call the operation originally named getTracking |
||
159 | * Meta informations extracted from the WSDL |
||
160 | * - documentation: Get Tracking of Shipment by Air waybill Number |
||
161 | * |
||
162 | * @uses AbstractSoapClientBase::getSoapClient() |
||
163 | * @uses AbstractSoapClientBase::setResult() |
||
164 | * @uses AbstractSoapClientBase::getResult() |
||
165 | * @uses AbstractSoapClientBase::saveLastError() |
||
166 | * |
||
167 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetTracking $parameters |
||
168 | * |
||
169 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetTrackingResponse|bool |
||
170 | */ |
||
171 | public function getTracking(\Alhoqbani\SmsaWebService\Soap\Type\GetTracking $parameters) |
||
183 | |||
184 | /** |
||
185 | * Method to call the operation originally named getTrackingwithRef |
||
186 | * Meta informations extracted from the WSDL |
||
187 | * - documentation: Get Tracking of Shipment with Reference Number by Air waybill Number |
||
188 | * |
||
189 | * @uses AbstractSoapClientBase::getSoapClient() |
||
190 | * @uses AbstractSoapClientBase::setResult() |
||
191 | * @uses AbstractSoapClientBase::getResult() |
||
192 | * @uses AbstractSoapClientBase::saveLastError() |
||
193 | * |
||
194 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetTrackingwithRef $parameters |
||
195 | * |
||
196 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetTrackingwithRefResponse|bool |
||
197 | */ |
||
198 | public function getTrackingwithRef(\Alhoqbani\SmsaWebService\Soap\Type\GetTrackingwithRef $parameters) |
||
210 | |||
211 | /** |
||
212 | * Method to call the operation originally named getStatus |
||
213 | * Meta informations extracted from the WSDL |
||
214 | * - documentation: Get current Status of Shipment by Air waybill Number |
||
215 | * |
||
216 | * @uses AbstractSoapClientBase::getSoapClient() |
||
217 | * @uses AbstractSoapClientBase::setResult() |
||
218 | * @uses AbstractSoapClientBase::getResult() |
||
219 | * @uses AbstractSoapClientBase::saveLastError() |
||
220 | * |
||
221 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetStatus $parameters |
||
222 | * |
||
223 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetStatusResponse|bool |
||
224 | */ |
||
225 | public function getStatus(\Alhoqbani\SmsaWebService\Soap\Type\GetStatus $parameters) |
||
237 | |||
238 | /** |
||
239 | * Method to call the operation originally named saphOrderReady |
||
240 | * |
||
241 | * @uses AbstractSoapClientBase::getSoapClient() |
||
242 | * @uses AbstractSoapClientBase::setResult() |
||
243 | * @uses AbstractSoapClientBase::getResult() |
||
244 | * @uses AbstractSoapClientBase::saveLastError() |
||
245 | * |
||
246 | * @param \Alhoqbani\SmsaWebService\Soap\Type\SaphOrderReady $parameters |
||
247 | * |
||
248 | * @return \Alhoqbani\SmsaWebService\Soap\Type\SaphOrderReadyResponse|bool |
||
249 | */ |
||
250 | public function saphOrderReady(\Alhoqbani\SmsaWebService\Soap\Type\SaphOrderReady $parameters) |
||
262 | |||
263 | /** |
||
264 | * Method to call the operation originally named getStatusByRef |
||
265 | * Meta informations extracted from the WSDL |
||
266 | * - documentation: Get Status of Shipment by Customer Reference Number |
||
267 | * |
||
268 | * @uses AbstractSoapClientBase::getSoapClient() |
||
269 | * @uses AbstractSoapClientBase::setResult() |
||
270 | * @uses AbstractSoapClientBase::getResult() |
||
271 | * @uses AbstractSoapClientBase::saveLastError() |
||
272 | * |
||
273 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetStatusByRef $parameters |
||
274 | * |
||
275 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetStatusByRefResponse|bool |
||
276 | */ |
||
277 | public function getStatusByRef(\Alhoqbani\SmsaWebService\Soap\Type\GetStatusByRef $parameters) |
||
289 | |||
290 | /** |
||
291 | * Method to call the operation originally named getTrackingByRef |
||
292 | * Meta informations extracted from the WSDL |
||
293 | * - documentation: Get Tracking of Shipment by Air waybill Number |
||
294 | * |
||
295 | * @uses AbstractSoapClientBase::getSoapClient() |
||
296 | * @uses AbstractSoapClientBase::setResult() |
||
297 | * @uses AbstractSoapClientBase::getResult() |
||
298 | * @uses AbstractSoapClientBase::saveLastError() |
||
299 | * |
||
300 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetTrackingByRef $parameters |
||
301 | * |
||
302 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetTrackingByRefResponse|bool |
||
303 | */ |
||
304 | public function getTrackingByRef(\Alhoqbani\SmsaWebService\Soap\Type\GetTrackingByRef $parameters) |
||
316 | |||
317 | /** |
||
318 | * Method to call the operation originally named getShipUpdates |
||
319 | * Meta informations extracted from the WSDL |
||
320 | * - documentation: Get All the Shipment Updates for the customer shipments |
||
321 | * |
||
322 | * @uses AbstractSoapClientBase::getSoapClient() |
||
323 | * @uses AbstractSoapClientBase::setResult() |
||
324 | * @uses AbstractSoapClientBase::getResult() |
||
325 | * @uses AbstractSoapClientBase::saveLastError() |
||
326 | * |
||
327 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetShipUpdates $parameters |
||
328 | * |
||
329 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetShipUpdatesResponse|bool |
||
330 | */ |
||
331 | public function getShipUpdates(\Alhoqbani\SmsaWebService\Soap\Type\GetShipUpdates $parameters) |
||
343 | |||
344 | /** |
||
345 | * Method to call the operation originally named cancelShipment |
||
346 | * Meta informations extracted from the WSDL |
||
347 | * - documentation: Cancel a Shipment by Air waybill Number |
||
348 | * |
||
349 | * @uses AbstractSoapClientBase::getSoapClient() |
||
350 | * @uses AbstractSoapClientBase::setResult() |
||
351 | * @uses AbstractSoapClientBase::getResult() |
||
352 | * @uses AbstractSoapClientBase::saveLastError() |
||
353 | * |
||
354 | * @param \Alhoqbani\SmsaWebService\Soap\Type\CancelShipment $parameters |
||
355 | * |
||
356 | * @return \Alhoqbani\SmsaWebService\Soap\Type\CancelShipmentResponse|bool |
||
357 | */ |
||
358 | public function cancelShipment(\Alhoqbani\SmsaWebService\Soap\Type\CancelShipment $parameters) |
||
370 | |||
371 | /** |
||
372 | * Method to call the operation originally named getRTLCities |
||
373 | * Meta informations extracted from the WSDL |
||
374 | * - documentation: Get List of Cities for Retails list |
||
375 | * |
||
376 | * @uses AbstractSoapClientBase::getSoapClient() |
||
377 | * @uses AbstractSoapClientBase::setResult() |
||
378 | * @uses AbstractSoapClientBase::getResult() |
||
379 | * @uses AbstractSoapClientBase::saveLastError() |
||
380 | * |
||
381 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetRTLCities $parameters |
||
382 | * |
||
383 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetRTLCitiesResponse|bool |
||
384 | */ |
||
385 | public function getRTLCities(\Alhoqbani\SmsaWebService\Soap\Type\GetRTLCities $parameters) |
||
397 | |||
398 | /** |
||
399 | * Method to call the operation originally named getRTLRetails |
||
400 | * Meta informations extracted from the WSDL |
||
401 | * - documentation: Get Retails list by each city |
||
402 | * |
||
403 | * @uses AbstractSoapClientBase::getSoapClient() |
||
404 | * @uses AbstractSoapClientBase::setResult() |
||
405 | * @uses AbstractSoapClientBase::getResult() |
||
406 | * @uses AbstractSoapClientBase::saveLastError() |
||
407 | * |
||
408 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetRTLRetails $parameters |
||
409 | * |
||
410 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetRTLRetailsResponse|bool |
||
411 | */ |
||
412 | public function getRTLRetails(\Alhoqbani\SmsaWebService\Soap\Type\GetRTLRetails $parameters) |
||
424 | |||
425 | /** |
||
426 | * Method to call the operation originally named getAllRetails |
||
427 | * Meta informations extracted from the WSDL |
||
428 | * - documentation: Get Retails list by each city |
||
429 | * |
||
430 | * @uses AbstractSoapClientBase::getSoapClient() |
||
431 | * @uses AbstractSoapClientBase::setResult() |
||
432 | * @uses AbstractSoapClientBase::getResult() |
||
433 | * @uses AbstractSoapClientBase::saveLastError() |
||
434 | * |
||
435 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetAllRetails $parameters |
||
436 | * |
||
437 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetAllRetailsResponse|bool |
||
438 | */ |
||
439 | public function getAllRetails(\Alhoqbani\SmsaWebService\Soap\Type\GetAllRetails $parameters) |
||
451 | |||
452 | /** |
||
453 | * Method to call the operation originally named getPDF |
||
454 | * Meta informations extracted from the WSDL |
||
455 | * - documentation: Get AWB Print in PDF |
||
456 | * |
||
457 | * @uses AbstractSoapClientBase::getSoapClient() |
||
458 | * @uses AbstractSoapClientBase::setResult() |
||
459 | * @uses AbstractSoapClientBase::getResult() |
||
460 | * @uses AbstractSoapClientBase::saveLastError() |
||
461 | * |
||
462 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetPDF $parameters |
||
463 | * |
||
464 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFResponse|bool |
||
465 | */ |
||
466 | public function getPDF(\Alhoqbani\SmsaWebService\Soap\Type\GetPDF $parameters) |
||
478 | |||
479 | /** |
||
480 | * Method to call the operation originally named getPDFSino |
||
481 | * Meta informations extracted from the WSDL |
||
482 | * - documentation: Get AWB Print in PDF |
||
483 | * |
||
484 | * @uses AbstractSoapClientBase::getSoapClient() |
||
485 | * @uses AbstractSoapClientBase::setResult() |
||
486 | * @uses AbstractSoapClientBase::getResult() |
||
487 | * @uses AbstractSoapClientBase::saveLastError() |
||
488 | * |
||
489 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetPDFSino $parameters |
||
490 | * |
||
491 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFSinoResponse|bool |
||
492 | */ |
||
493 | public function getPDFSino(\Alhoqbani\SmsaWebService\Soap\Type\GetPDFSino $parameters) |
||
505 | |||
506 | /** |
||
507 | * Method to call the operation originally named getPDFBr |
||
508 | * Meta informations extracted from the WSDL |
||
509 | * - documentation: Get AWB Print in PDF |
||
510 | * |
||
511 | * @uses AbstractSoapClientBase::getSoapClient() |
||
512 | * @uses AbstractSoapClientBase::setResult() |
||
513 | * @uses AbstractSoapClientBase::getResult() |
||
514 | * @uses AbstractSoapClientBase::saveLastError() |
||
515 | * |
||
516 | * @param \Alhoqbani\SmsaWebService\Soap\Type\GetPDFBr $parameters |
||
517 | * |
||
518 | * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFBrResponse|bool |
||
519 | */ |
||
520 | public function getPDFBr(\Alhoqbani\SmsaWebService\Soap\Type\GetPDFBr $parameters) |
||
532 | |||
533 | /** |
||
534 | * Returns the result |
||
535 | * |
||
536 | * @see AbstractSoapClientBase::getResult() |
||
537 | * |
||
538 | * @return \Alhoqbani\SmsaWebService\Soap\Type\AddShipmentDelvResponse|\Alhoqbani\SmsaWebService\Soap\Type\AddShipmentResponse|\Alhoqbani\SmsaWebService\Soap\Type\AddShipMPSResponse|\Alhoqbani\SmsaWebService\Soap\Type\AddShipResponse|\Alhoqbani\SmsaWebService\Soap\Type\CancelShipmentResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetAllRetailsResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetPDFBrResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetPDFResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetPDFSinoResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetRTLCitiesResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetRTLRetailsResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetShipUpdatesResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetStatusByRefResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetStatusResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetTrackingByRefResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetTrackingResponse|\Alhoqbani\SmsaWebService\Soap\Type\GetTrackingwithRefResponse|\Alhoqbani\SmsaWebService\Soap\Type\SaphOrderReadyResponse|\Alhoqbani\SmsaWebService\Soap\Type\StoShipmentResponse |
||
539 | */ |
||
540 | public function getResult() |
||
544 | |||
545 | /** |
||
546 | * Method returning the class name |
||
547 | * |
||
548 | * @return string __CLASS__ |
||
549 | */ |
||
550 | public function __toString() |
||
554 | } |
||
555 |