Complex classes like GetSingleStayValueRBO 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 GetSingleStayValueRBO, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 5 | class GetSingleStayValueRBO |
||
| 6 | { |
||
| 7 | |||
| 8 | /** |
||
| 9 | * @var int $intGUID |
||
| 10 | */ |
||
| 11 | protected $intGUID = null; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var string $strISOLanguage |
||
| 15 | */ |
||
| 16 | protected $strISOLanguage = null; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var int $intRoomType |
||
| 20 | */ |
||
| 21 | protected $intRoomType = null; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var int $intRateID |
||
| 25 | */ |
||
| 26 | protected $intRateID = null; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var int $ID_PromoCode |
||
| 30 | */ |
||
| 31 | protected $ID_PromoCode = null; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var int $intGuestCount |
||
| 35 | */ |
||
| 36 | protected $intGuestCount = null; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var string $strChildren |
||
| 40 | */ |
||
| 41 | protected $strChildren = null; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @var \DateTime $dArrDate |
||
| 45 | */ |
||
| 46 | protected $dArrDate = null; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @var \DateTime $dDepDate |
||
| 50 | */ |
||
| 51 | protected $dDepDate = null; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @var string $strAttributes |
||
| 55 | */ |
||
| 56 | protected $strAttributes = null; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @var string $strLocations |
||
| 60 | */ |
||
| 61 | protected $strLocations = null; |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @var dstElements $dstElements |
||
| 65 | */ |
||
| 66 | protected $dstElements = null; |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @var int $intRoomQty |
||
| 70 | */ |
||
| 71 | protected $intRoomQty = null; |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @var boolean $IsInsuranceAccepted |
||
| 75 | */ |
||
| 76 | protected $IsInsuranceAccepted = null; |
||
| 77 | |||
| 78 | /** |
||
| 79 | * @var string $strAttributeGroupings |
||
| 80 | */ |
||
| 81 | protected $strAttributeGroupings = null; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @var string $strLocationsGroupings |
||
| 85 | */ |
||
| 86 | protected $strLocationsGroupings = null; |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @var boolean $isRBO |
||
| 90 | */ |
||
| 91 | protected $isRBO = null; |
||
| 92 | |||
| 93 | /** |
||
| 94 | * @var boolean $MustEvaluateRBO |
||
| 95 | */ |
||
| 96 | protected $MustEvaluateRBO = null; |
||
| 97 | |||
| 98 | /** |
||
| 99 | * @var string $StrListSpecialOffertApplicable |
||
| 100 | */ |
||
| 101 | protected $StrListSpecialOffertApplicable = null; |
||
| 102 | |||
| 103 | /** |
||
| 104 | * @var XMLDailyManualRates $XMLDailyManualRates |
||
| 105 | */ |
||
| 106 | protected $XMLDailyManualRates = null; |
||
| 107 | |||
| 108 | /** |
||
| 109 | * @var string $XMLDailyRates |
||
| 110 | */ |
||
| 111 | protected $XMLDailyRates = null; |
||
| 112 | |||
| 113 | /** |
||
| 114 | * @var string $XMLServicesChargesALaCarte |
||
| 115 | */ |
||
| 116 | protected $XMLServicesChargesALaCarte = null; |
||
| 117 | |||
| 118 | /** |
||
| 119 | * @var int $ID_Room |
||
| 120 | */ |
||
| 121 | protected $ID_Room = null; |
||
| 122 | |||
| 123 | /** |
||
| 124 | * @var int $ID_Building |
||
| 125 | */ |
||
| 126 | protected $ID_Building = null; |
||
| 127 | |||
| 128 | /** |
||
| 129 | * @var int $intBusinessSourceID |
||
| 130 | */ |
||
| 131 | protected $intBusinessSourceID = null; |
||
| 132 | |||
| 133 | /** |
||
| 134 | * @param int $intGUID |
||
| 135 | * @param string $strISOLanguage |
||
| 136 | * @param int $intRoomType |
||
| 137 | * @param int $intRateID |
||
| 138 | * @param int $ID_PromoCode |
||
| 139 | * @param int $intGuestCount |
||
| 140 | * @param string $strChildren |
||
| 141 | * @param \DateTime $dArrDate |
||
| 142 | * @param \DateTime $dDepDate |
||
| 143 | * @param string $strAttributes |
||
| 144 | * @param string $strLocations |
||
| 145 | * @param dstElements $dstElements |
||
| 146 | * @param int $intRoomQty |
||
| 147 | * @param boolean $IsInsuranceAccepted |
||
| 148 | * @param string $strAttributeGroupings |
||
| 149 | * @param string $strLocationsGroupings |
||
| 150 | * @param boolean $isRBO |
||
| 151 | * @param boolean $MustEvaluateRBO |
||
| 152 | * @param string $StrListSpecialOffertApplicable |
||
| 153 | * @param XMLDailyManualRates $XMLDailyManualRates |
||
| 154 | * @param string $XMLDailyRates |
||
| 155 | * @param string $XMLServicesChargesALaCarte |
||
| 156 | * @param int $ID_Room |
||
| 157 | * @param int $ID_Building |
||
| 158 | * @param int $intBusinessSourceID |
||
| 159 | */ |
||
| 160 | public function __construct($intGUID, $strISOLanguage, $intRoomType, $intRateID, $ID_PromoCode, $intGuestCount, $strChildren, \DateTime $dArrDate, \DateTime $dDepDate, $strAttributes, $strLocations, $dstElements, $intRoomQty, $IsInsuranceAccepted, $strAttributeGroupings, $strLocationsGroupings, $isRBO, $MustEvaluateRBO, $StrListSpecialOffertApplicable, $XMLDailyManualRates, $XMLDailyRates, $XMLServicesChargesALaCarte, $ID_Room, $ID_Building, $intBusinessSourceID) |
||
| 188 | |||
| 189 | /** |
||
| 190 | * @return int |
||
| 191 | */ |
||
| 192 | public function getIntGUID() |
||
| 196 | |||
| 197 | /** |
||
| 198 | * @param int $intGUID |
||
| 199 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 200 | */ |
||
| 201 | public function setIntGUID($intGUID) |
||
| 206 | |||
| 207 | /** |
||
| 208 | * @return string |
||
| 209 | */ |
||
| 210 | public function getStrISOLanguage() |
||
| 214 | |||
| 215 | /** |
||
| 216 | * @param string $strISOLanguage |
||
| 217 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 218 | */ |
||
| 219 | public function setStrISOLanguage($strISOLanguage) |
||
| 224 | |||
| 225 | /** |
||
| 226 | * @return int |
||
| 227 | */ |
||
| 228 | public function getIntRoomType() |
||
| 232 | |||
| 233 | /** |
||
| 234 | * @param int $intRoomType |
||
| 235 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 236 | */ |
||
| 237 | public function setIntRoomType($intRoomType) |
||
| 242 | |||
| 243 | /** |
||
| 244 | * @return int |
||
| 245 | */ |
||
| 246 | public function getIntRateID() |
||
| 250 | |||
| 251 | /** |
||
| 252 | * @param int $intRateID |
||
| 253 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 254 | */ |
||
| 255 | public function setIntRateID($intRateID) |
||
| 260 | |||
| 261 | /** |
||
| 262 | * @return int |
||
| 263 | */ |
||
| 264 | public function getID_PromoCode() |
||
| 268 | |||
| 269 | /** |
||
| 270 | * @param int $ID_PromoCode |
||
| 271 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 272 | */ |
||
| 273 | public function setID_PromoCode($ID_PromoCode) |
||
| 278 | |||
| 279 | /** |
||
| 280 | * @return int |
||
| 281 | */ |
||
| 282 | public function getIntGuestCount() |
||
| 286 | |||
| 287 | /** |
||
| 288 | * @param int $intGuestCount |
||
| 289 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 290 | */ |
||
| 291 | public function setIntGuestCount($intGuestCount) |
||
| 296 | |||
| 297 | /** |
||
| 298 | * @return string |
||
| 299 | */ |
||
| 300 | public function getStrChildren() |
||
| 304 | |||
| 305 | /** |
||
| 306 | * @param string $strChildren |
||
| 307 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 308 | */ |
||
| 309 | public function setStrChildren($strChildren) |
||
| 314 | |||
| 315 | /** |
||
| 316 | * @return \DateTime |
||
| 317 | */ |
||
| 318 | public function getDArrDate() |
||
| 330 | |||
| 331 | /** |
||
| 332 | * @param \DateTime $dArrDate |
||
| 333 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 334 | */ |
||
| 335 | public function setDArrDate(\DateTime $dArrDate) |
||
| 340 | |||
| 341 | /** |
||
| 342 | * @return \DateTime |
||
| 343 | */ |
||
| 344 | public function getDDepDate() |
||
| 356 | |||
| 357 | /** |
||
| 358 | * @param \DateTime $dDepDate |
||
| 359 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 360 | */ |
||
| 361 | public function setDDepDate(\DateTime $dDepDate) |
||
| 366 | |||
| 367 | /** |
||
| 368 | * @return string |
||
| 369 | */ |
||
| 370 | public function getStrAttributes() |
||
| 374 | |||
| 375 | /** |
||
| 376 | * @param string $strAttributes |
||
| 377 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 378 | */ |
||
| 379 | public function setStrAttributes($strAttributes) |
||
| 384 | |||
| 385 | /** |
||
| 386 | * @return string |
||
| 387 | */ |
||
| 388 | public function getStrLocations() |
||
| 392 | |||
| 393 | /** |
||
| 394 | * @param string $strLocations |
||
| 395 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 396 | */ |
||
| 397 | public function setStrLocations($strLocations) |
||
| 402 | |||
| 403 | /** |
||
| 404 | * @return dstElements |
||
| 405 | */ |
||
| 406 | public function getDstElements() |
||
| 410 | |||
| 411 | /** |
||
| 412 | * @param dstElements $dstElements |
||
| 413 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 414 | */ |
||
| 415 | public function setDstElements($dstElements) |
||
| 420 | |||
| 421 | /** |
||
| 422 | * @return int |
||
| 423 | */ |
||
| 424 | public function getIntRoomQty() |
||
| 428 | |||
| 429 | /** |
||
| 430 | * @param int $intRoomQty |
||
| 431 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 432 | */ |
||
| 433 | public function setIntRoomQty($intRoomQty) |
||
| 438 | |||
| 439 | /** |
||
| 440 | * @return boolean |
||
| 441 | */ |
||
| 442 | public function getIsInsuranceAccepted() |
||
| 446 | |||
| 447 | /** |
||
| 448 | * @param boolean $IsInsuranceAccepted |
||
| 449 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 450 | */ |
||
| 451 | public function setIsInsuranceAccepted($IsInsuranceAccepted) |
||
| 456 | |||
| 457 | /** |
||
| 458 | * @return string |
||
| 459 | */ |
||
| 460 | public function getStrAttributeGroupings() |
||
| 464 | |||
| 465 | /** |
||
| 466 | * @param string $strAttributeGroupings |
||
| 467 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 468 | */ |
||
| 469 | public function setStrAttributeGroupings($strAttributeGroupings) |
||
| 474 | |||
| 475 | /** |
||
| 476 | * @return string |
||
| 477 | */ |
||
| 478 | public function getStrLocationsGroupings() |
||
| 482 | |||
| 483 | /** |
||
| 484 | * @param string $strLocationsGroupings |
||
| 485 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 486 | */ |
||
| 487 | public function setStrLocationsGroupings($strLocationsGroupings) |
||
| 492 | |||
| 493 | /** |
||
| 494 | * @return boolean |
||
| 495 | */ |
||
| 496 | public function getIsRBO() |
||
| 500 | |||
| 501 | /** |
||
| 502 | * @param boolean $isRBO |
||
| 503 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 504 | */ |
||
| 505 | public function setIsRBO($isRBO) |
||
| 510 | |||
| 511 | /** |
||
| 512 | * @return boolean |
||
| 513 | */ |
||
| 514 | public function getMustEvaluateRBO() |
||
| 518 | |||
| 519 | /** |
||
| 520 | * @param boolean $MustEvaluateRBO |
||
| 521 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 522 | */ |
||
| 523 | public function setMustEvaluateRBO($MustEvaluateRBO) |
||
| 528 | |||
| 529 | /** |
||
| 530 | * @return string |
||
| 531 | */ |
||
| 532 | public function getStrListSpecialOffertApplicable() |
||
| 536 | |||
| 537 | /** |
||
| 538 | * @param string $StrListSpecialOffertApplicable |
||
| 539 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 540 | */ |
||
| 541 | public function setStrListSpecialOffertApplicable($StrListSpecialOffertApplicable) |
||
| 546 | |||
| 547 | /** |
||
| 548 | * @return XMLDailyManualRates |
||
| 549 | */ |
||
| 550 | public function getXMLDailyManualRates() |
||
| 554 | |||
| 555 | /** |
||
| 556 | * @param XMLDailyManualRates $XMLDailyManualRates |
||
| 557 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 558 | */ |
||
| 559 | public function setXMLDailyManualRates($XMLDailyManualRates) |
||
| 564 | |||
| 565 | /** |
||
| 566 | * @return string |
||
| 567 | */ |
||
| 568 | public function getXMLDailyRates() |
||
| 572 | |||
| 573 | /** |
||
| 574 | * @param string $XMLDailyRates |
||
| 575 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 576 | */ |
||
| 577 | public function setXMLDailyRates($XMLDailyRates) |
||
| 582 | |||
| 583 | /** |
||
| 584 | * @return string |
||
| 585 | */ |
||
| 586 | public function getXMLServicesChargesALaCarte() |
||
| 590 | |||
| 591 | /** |
||
| 592 | * @param string $XMLServicesChargesALaCarte |
||
| 593 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 594 | */ |
||
| 595 | public function setXMLServicesChargesALaCarte($XMLServicesChargesALaCarte) |
||
| 600 | |||
| 601 | /** |
||
| 602 | * @return int |
||
| 603 | */ |
||
| 604 | public function getID_Room() |
||
| 608 | |||
| 609 | /** |
||
| 610 | * @param int $ID_Room |
||
| 611 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 612 | */ |
||
| 613 | public function setID_Room($ID_Room) |
||
| 618 | |||
| 619 | /** |
||
| 620 | * @return int |
||
| 621 | */ |
||
| 622 | public function getID_Building() |
||
| 626 | |||
| 627 | /** |
||
| 628 | * @param int $ID_Building |
||
| 629 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 630 | */ |
||
| 631 | public function setID_Building($ID_Building) |
||
| 636 | |||
| 637 | /** |
||
| 638 | * @return int |
||
| 639 | */ |
||
| 640 | public function getIntBusinessSourceID() |
||
| 644 | |||
| 645 | /** |
||
| 646 | * @param int $intBusinessSourceID |
||
| 647 | * @return \Gueststream\PMS\IQWare\API\GetSingleStayValueRBO |
||
| 648 | */ |
||
| 649 | public function setIntBusinessSourceID($intBusinessSourceID) |
||
| 654 | } |
||
| 655 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..