| Total Complexity | 65 |
| Total Lines | 478 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Complex classes like FindRDVPointRetraitAcheminement 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.
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 FindRDVPointRetraitAcheminement, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 14 | class FindRDVPointRetraitAcheminement extends AbstractStructBase |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * The accountNumber |
||
| 18 | * Meta information extracted from the WSDL |
||
| 19 | * - minOccurs: 0 |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | public $accountNumber; |
||
| 23 | /** |
||
| 24 | * The password |
||
| 25 | * Meta information extracted from the WSDL |
||
| 26 | * - minOccurs: 0 |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | public $password; |
||
| 30 | /** |
||
| 31 | * The apikey |
||
| 32 | * Meta information extracted from the WSDL |
||
| 33 | * - default: |
||
| 34 | * - minOccurs: 0 |
||
| 35 | * - nillable: true |
||
| 36 | * @var string |
||
| 37 | */ |
||
| 38 | public $apikey; |
||
| 39 | /** |
||
| 40 | * The codTiersPourPartenaire |
||
| 41 | * Meta information extracted from the WSDL |
||
| 42 | * - default: |
||
| 43 | * - minOccurs: 0 |
||
| 44 | * - nillable: true |
||
| 45 | * @var string |
||
| 46 | */ |
||
| 47 | public $codTiersPourPartenaire; |
||
| 48 | /** |
||
| 49 | * The address |
||
| 50 | * Meta information extracted from the WSDL |
||
| 51 | * - minOccurs: 0 |
||
| 52 | * @var string |
||
| 53 | */ |
||
| 54 | public $address; |
||
| 55 | /** |
||
| 56 | * The zipCode |
||
| 57 | * Meta information extracted from the WSDL |
||
| 58 | * - minOccurs: 0 |
||
| 59 | * @var string |
||
| 60 | */ |
||
| 61 | public $zipCode; |
||
| 62 | /** |
||
| 63 | * The city |
||
| 64 | * Meta information extracted from the WSDL |
||
| 65 | * - minOccurs: 0 |
||
| 66 | * @var string |
||
| 67 | */ |
||
| 68 | public $city; |
||
| 69 | /** |
||
| 70 | * The countryCode |
||
| 71 | * Meta information extracted from the WSDL |
||
| 72 | * - minOccurs: 0 |
||
| 73 | * @var string |
||
| 74 | */ |
||
| 75 | public $countryCode; |
||
| 76 | /** |
||
| 77 | * The weight |
||
| 78 | * Meta information extracted from the WSDL |
||
| 79 | * - minOccurs: 0 |
||
| 80 | * @var string |
||
| 81 | */ |
||
| 82 | public $weight; |
||
| 83 | /** |
||
| 84 | * The shippingDate |
||
| 85 | * Meta information extracted from the WSDL |
||
| 86 | * - minOccurs: 0 |
||
| 87 | * @var string |
||
| 88 | */ |
||
| 89 | public $shippingDate; |
||
| 90 | /** |
||
| 91 | * The filterRelay |
||
| 92 | * Meta information extracted from the WSDL |
||
| 93 | * - minOccurs: 0 |
||
| 94 | * @var string |
||
| 95 | */ |
||
| 96 | public $filterRelay; |
||
| 97 | /** |
||
| 98 | * The requestId |
||
| 99 | * Meta information extracted from the WSDL |
||
| 100 | * - minOccurs: 0 |
||
| 101 | * @var string |
||
| 102 | */ |
||
| 103 | public $requestId; |
||
| 104 | /** |
||
| 105 | * The lang |
||
| 106 | * Meta information extracted from the WSDL |
||
| 107 | * - minOccurs: 0 |
||
| 108 | * @var string |
||
| 109 | */ |
||
| 110 | public $lang; |
||
| 111 | /** |
||
| 112 | * The optionInter |
||
| 113 | * Meta information extracted from the WSDL |
||
| 114 | * - minOccurs: 0 |
||
| 115 | * @var string |
||
| 116 | */ |
||
| 117 | public $optionInter; |
||
| 118 | /** |
||
| 119 | * Constructor method for findRDVPointRetraitAcheminement |
||
| 120 | * @uses FindRDVPointRetraitAcheminement::setAccountNumber() |
||
| 121 | * @uses FindRDVPointRetraitAcheminement::setPassword() |
||
| 122 | * @uses FindRDVPointRetraitAcheminement::setApikey() |
||
| 123 | * @uses FindRDVPointRetraitAcheminement::setCodTiersPourPartenaire() |
||
| 124 | * @uses FindRDVPointRetraitAcheminement::setAddress() |
||
| 125 | * @uses FindRDVPointRetraitAcheminement::setZipCode() |
||
| 126 | * @uses FindRDVPointRetraitAcheminement::setCity() |
||
| 127 | * @uses FindRDVPointRetraitAcheminement::setCountryCode() |
||
| 128 | * @uses FindRDVPointRetraitAcheminement::setWeight() |
||
| 129 | * @uses FindRDVPointRetraitAcheminement::setShippingDate() |
||
| 130 | * @uses FindRDVPointRetraitAcheminement::setFilterRelay() |
||
| 131 | * @uses FindRDVPointRetraitAcheminement::setRequestId() |
||
| 132 | * @uses FindRDVPointRetraitAcheminement::setLang() |
||
| 133 | * @uses FindRDVPointRetraitAcheminement::setOptionInter() |
||
| 134 | * @param string $accountNumber |
||
| 135 | * @param string $password |
||
| 136 | * @param string $apikey |
||
| 137 | * @param string $codTiersPourPartenaire |
||
| 138 | * @param string $address |
||
| 139 | * @param string $zipCode |
||
| 140 | * @param string $city |
||
| 141 | * @param string $countryCode |
||
| 142 | * @param string $weight |
||
| 143 | * @param string $shippingDate |
||
| 144 | * @param string $filterRelay |
||
| 145 | * @param string $requestId |
||
| 146 | * @param string $lang |
||
| 147 | * @param string $optionInter |
||
| 148 | */ |
||
| 149 | public function __construct($accountNumber = null, $password = null, $apikey = '', $codTiersPourPartenaire = '', $address = null, $zipCode = null, $city = null, $countryCode = null, $weight = null, $shippingDate = null, $filterRelay = null, $requestId = null, $lang = null, $optionInter = null) |
||
| 150 | { |
||
| 151 | $this |
||
| 152 | ->setAccountNumber($accountNumber) |
||
| 153 | ->setPassword($password) |
||
| 154 | ->setApikey($apikey) |
||
| 155 | ->setCodTiersPourPartenaire($codTiersPourPartenaire) |
||
| 156 | ->setAddress($address) |
||
| 157 | ->setZipCode($zipCode) |
||
| 158 | ->setCity($city) |
||
| 159 | ->setCountryCode($countryCode) |
||
| 160 | ->setWeight($weight) |
||
| 161 | ->setShippingDate($shippingDate) |
||
| 162 | ->setFilterRelay($filterRelay) |
||
| 163 | ->setRequestId($requestId) |
||
| 164 | ->setLang($lang) |
||
| 165 | ->setOptionInter($optionInter); |
||
| 166 | } |
||
| 167 | /** |
||
| 168 | * Get accountNumber value |
||
| 169 | * @return string|null |
||
| 170 | */ |
||
| 171 | public function getAccountNumber() |
||
| 172 | { |
||
| 173 | return $this->accountNumber; |
||
| 174 | } |
||
| 175 | /** |
||
| 176 | * Set accountNumber value |
||
| 177 | * @param string $accountNumber |
||
| 178 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 179 | */ |
||
| 180 | public function setAccountNumber($accountNumber = null) |
||
| 181 | { |
||
| 182 | // validation for constraint: string |
||
| 183 | if (!is_null($accountNumber) && !is_string($accountNumber)) { |
||
|
|
|||
| 184 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($accountNumber, true), gettype($accountNumber)), __LINE__); |
||
| 185 | } |
||
| 186 | $this->accountNumber = $accountNumber; |
||
| 187 | return $this; |
||
| 188 | } |
||
| 189 | /** |
||
| 190 | * Get password value |
||
| 191 | * @return string|null |
||
| 192 | */ |
||
| 193 | public function getPassword() |
||
| 194 | { |
||
| 195 | return $this->password; |
||
| 196 | } |
||
| 197 | /** |
||
| 198 | * Set password value |
||
| 199 | * @param string $password |
||
| 200 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 201 | */ |
||
| 202 | public function setPassword($password = null) |
||
| 203 | { |
||
| 204 | // validation for constraint: string |
||
| 205 | if (!is_null($password) && !is_string($password)) { |
||
| 206 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($password, true), gettype($password)), __LINE__); |
||
| 207 | } |
||
| 208 | $this->password = $password; |
||
| 209 | return $this; |
||
| 210 | } |
||
| 211 | /** |
||
| 212 | * Get apikey value |
||
| 213 | * An additional test has been added (isset) before returning the property value as |
||
| 214 | * this property may have been unset before, due to the fact that this property is |
||
| 215 | * removable from the request (nillable=true+minOccurs=0) |
||
| 216 | * @return string|null |
||
| 217 | */ |
||
| 218 | public function getApikey() |
||
| 219 | { |
||
| 220 | return isset($this->apikey) ? $this->apikey : null; |
||
| 221 | } |
||
| 222 | /** |
||
| 223 | * Set apikey value |
||
| 224 | * This property is removable from request (nillable=true+minOccurs=0), therefore |
||
| 225 | * if the value assigned to this property is null, it is removed from this object |
||
| 226 | * @param string $apikey |
||
| 227 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 228 | */ |
||
| 229 | public function setApikey($apikey = '') |
||
| 230 | { |
||
| 231 | // validation for constraint: string |
||
| 232 | if (!is_null($apikey) && !is_string($apikey)) { |
||
| 233 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($apikey, true), gettype($apikey)), __LINE__); |
||
| 234 | } |
||
| 235 | if (is_null($apikey) || (is_array($apikey) && empty($apikey))) { |
||
| 236 | unset($this->apikey); |
||
| 237 | } else { |
||
| 238 | $this->apikey = $apikey; |
||
| 239 | } |
||
| 240 | return $this; |
||
| 241 | } |
||
| 242 | /** |
||
| 243 | * Get codTiersPourPartenaire value |
||
| 244 | * An additional test has been added (isset) before returning the property value as |
||
| 245 | * this property may have been unset before, due to the fact that this property is |
||
| 246 | * removable from the request (nillable=true+minOccurs=0) |
||
| 247 | * @return string|null |
||
| 248 | */ |
||
| 249 | public function getCodTiersPourPartenaire() |
||
| 250 | { |
||
| 251 | return isset($this->codTiersPourPartenaire) ? $this->codTiersPourPartenaire : null; |
||
| 252 | } |
||
| 253 | /** |
||
| 254 | * Set codTiersPourPartenaire value |
||
| 255 | * This property is removable from request (nillable=true+minOccurs=0), therefore |
||
| 256 | * if the value assigned to this property is null, it is removed from this object |
||
| 257 | * @param string $codTiersPourPartenaire |
||
| 258 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 259 | */ |
||
| 260 | public function setCodTiersPourPartenaire($codTiersPourPartenaire = '') |
||
| 261 | { |
||
| 262 | // validation for constraint: string |
||
| 263 | if (!is_null($codTiersPourPartenaire) && !is_string($codTiersPourPartenaire)) { |
||
| 264 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($codTiersPourPartenaire, true), gettype($codTiersPourPartenaire)), __LINE__); |
||
| 265 | } |
||
| 266 | if (is_null($codTiersPourPartenaire) || (is_array($codTiersPourPartenaire) && empty($codTiersPourPartenaire))) { |
||
| 267 | unset($this->codTiersPourPartenaire); |
||
| 268 | } else { |
||
| 269 | $this->codTiersPourPartenaire = $codTiersPourPartenaire; |
||
| 270 | } |
||
| 271 | return $this; |
||
| 272 | } |
||
| 273 | /** |
||
| 274 | * Get address value |
||
| 275 | * @return string|null |
||
| 276 | */ |
||
| 277 | public function getAddress() |
||
| 278 | { |
||
| 279 | return $this->address; |
||
| 280 | } |
||
| 281 | /** |
||
| 282 | * Set address value |
||
| 283 | * @param string $address |
||
| 284 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 285 | */ |
||
| 286 | public function setAddress($address = null) |
||
| 287 | { |
||
| 288 | // validation for constraint: string |
||
| 289 | if (!is_null($address) && !is_string($address)) { |
||
| 290 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($address, true), gettype($address)), __LINE__); |
||
| 291 | } |
||
| 292 | $this->address = $address; |
||
| 293 | return $this; |
||
| 294 | } |
||
| 295 | /** |
||
| 296 | * Get zipCode value |
||
| 297 | * @return string|null |
||
| 298 | */ |
||
| 299 | public function getZipCode() |
||
| 300 | { |
||
| 301 | return $this->zipCode; |
||
| 302 | } |
||
| 303 | /** |
||
| 304 | * Set zipCode value |
||
| 305 | * @param string $zipCode |
||
| 306 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 307 | */ |
||
| 308 | public function setZipCode($zipCode = null) |
||
| 309 | { |
||
| 310 | // validation for constraint: string |
||
| 311 | if (!is_null($zipCode) && !is_string($zipCode)) { |
||
| 312 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($zipCode, true), gettype($zipCode)), __LINE__); |
||
| 313 | } |
||
| 314 | $this->zipCode = $zipCode; |
||
| 315 | return $this; |
||
| 316 | } |
||
| 317 | /** |
||
| 318 | * Get city value |
||
| 319 | * @return string|null |
||
| 320 | */ |
||
| 321 | public function getCity() |
||
| 322 | { |
||
| 323 | return $this->city; |
||
| 324 | } |
||
| 325 | /** |
||
| 326 | * Set city value |
||
| 327 | * @param string $city |
||
| 328 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 329 | */ |
||
| 330 | public function setCity($city = null) |
||
| 338 | } |
||
| 339 | /** |
||
| 340 | * Get countryCode value |
||
| 341 | * @return string|null |
||
| 342 | */ |
||
| 343 | public function getCountryCode() |
||
| 344 | { |
||
| 345 | return $this->countryCode; |
||
| 346 | } |
||
| 347 | /** |
||
| 348 | * Set countryCode value |
||
| 349 | * @param string $countryCode |
||
| 350 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 351 | */ |
||
| 352 | public function setCountryCode($countryCode = null) |
||
| 353 | { |
||
| 354 | // validation for constraint: string |
||
| 355 | if (!is_null($countryCode) && !is_string($countryCode)) { |
||
| 356 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($countryCode, true), gettype($countryCode)), __LINE__); |
||
| 357 | } |
||
| 358 | $this->countryCode = $countryCode; |
||
| 359 | return $this; |
||
| 360 | } |
||
| 361 | /** |
||
| 362 | * Get weight value |
||
| 363 | * @return string|null |
||
| 364 | */ |
||
| 365 | public function getWeight() |
||
| 366 | { |
||
| 367 | return $this->weight; |
||
| 368 | } |
||
| 369 | /** |
||
| 370 | * Set weight value |
||
| 371 | * @param string $weight |
||
| 372 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 373 | */ |
||
| 374 | public function setWeight($weight = null) |
||
| 375 | { |
||
| 376 | // validation for constraint: string |
||
| 377 | if (!is_null($weight) && !is_string($weight)) { |
||
| 378 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($weight, true), gettype($weight)), __LINE__); |
||
| 379 | } |
||
| 380 | $this->weight = $weight; |
||
| 381 | return $this; |
||
| 382 | } |
||
| 383 | /** |
||
| 384 | * Get shippingDate value |
||
| 385 | * @return string|null |
||
| 386 | */ |
||
| 387 | public function getShippingDate() |
||
| 388 | { |
||
| 389 | return $this->shippingDate; |
||
| 390 | } |
||
| 391 | /** |
||
| 392 | * Set shippingDate value |
||
| 393 | * @param string $shippingDate |
||
| 394 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 395 | */ |
||
| 396 | public function setShippingDate($shippingDate = null) |
||
| 404 | } |
||
| 405 | /** |
||
| 406 | * Get filterRelay value |
||
| 407 | * @return string|null |
||
| 408 | */ |
||
| 409 | public function getFilterRelay() |
||
| 410 | { |
||
| 411 | return $this->filterRelay; |
||
| 412 | } |
||
| 413 | /** |
||
| 414 | * Set filterRelay value |
||
| 415 | * @param string $filterRelay |
||
| 416 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 417 | */ |
||
| 418 | public function setFilterRelay($filterRelay = null) |
||
| 419 | { |
||
| 420 | // validation for constraint: string |
||
| 421 | if (!is_null($filterRelay) && !is_string($filterRelay)) { |
||
| 422 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($filterRelay, true), gettype($filterRelay)), __LINE__); |
||
| 423 | } |
||
| 424 | $this->filterRelay = $filterRelay; |
||
| 425 | return $this; |
||
| 426 | } |
||
| 427 | /** |
||
| 428 | * Get requestId value |
||
| 429 | * @return string|null |
||
| 430 | */ |
||
| 431 | public function getRequestId() |
||
| 432 | { |
||
| 433 | return $this->requestId; |
||
| 434 | } |
||
| 435 | /** |
||
| 436 | * Set requestId value |
||
| 437 | * @param string $requestId |
||
| 438 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 439 | */ |
||
| 440 | public function setRequestId($requestId = null) |
||
| 448 | } |
||
| 449 | /** |
||
| 450 | * Get lang value |
||
| 451 | * @return string|null |
||
| 452 | */ |
||
| 453 | public function getLang() |
||
| 454 | { |
||
| 455 | return $this->lang; |
||
| 456 | } |
||
| 457 | /** |
||
| 458 | * Set lang value |
||
| 459 | * @param string $lang |
||
| 460 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 461 | */ |
||
| 462 | public function setLang($lang = null) |
||
| 463 | { |
||
| 464 | // validation for constraint: string |
||
| 465 | if (!is_null($lang) && !is_string($lang)) { |
||
| 466 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lang, true), gettype($lang)), __LINE__); |
||
| 467 | } |
||
| 468 | $this->lang = $lang; |
||
| 469 | return $this; |
||
| 470 | } |
||
| 471 | /** |
||
| 472 | * Get optionInter value |
||
| 473 | * @return string|null |
||
| 474 | */ |
||
| 475 | public function getOptionInter() |
||
| 476 | { |
||
| 477 | return $this->optionInter; |
||
| 478 | } |
||
| 479 | /** |
||
| 480 | * Set optionInter value |
||
| 481 | * @param string $optionInter |
||
| 482 | * @return \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement |
||
| 483 | */ |
||
| 484 | public function setOptionInter($optionInter = null) |
||
| 492 | } |
||
| 493 | } |
||
| 494 |