Complex classes like MembershipApplication 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 MembershipApplication, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 15 | class MembershipApplication { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var integer|null |
||
| 19 | * |
||
| 20 | * @ORM\Column(name="donation_id", type="integer", nullable=true) |
||
| 21 | */ |
||
| 22 | private $donationId; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var \DateTime |
||
| 26 | * |
||
| 27 | * @Gedmo\Timestampable(on="create") |
||
| 28 | * @ORM\Column(name="timestamp", type="datetime") |
||
| 29 | */ |
||
| 30 | private $timestamp; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var string|null |
||
| 34 | * |
||
| 35 | * @ORM\Column(name="anrede", type="string", length=16, nullable=true) |
||
| 36 | */ |
||
| 37 | private $salutation; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @var string|null |
||
| 41 | * |
||
| 42 | * @ORM\Column(name="firma", type="string", length=100, nullable=true) |
||
| 43 | */ |
||
| 44 | private $company; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @var string|null |
||
| 48 | * |
||
| 49 | * @ORM\Column(name="titel", type="string", length=16, nullable=true) |
||
| 50 | */ |
||
| 51 | private $title; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @var string |
||
| 55 | * |
||
| 56 | * @ORM\Column(name="name", type="string", length=250, options={"default":""}, nullable=false) |
||
| 57 | */ |
||
| 58 | private $name = ''; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @var string |
||
| 62 | * |
||
| 63 | * @ORM\Column(name="vorname", type="string", length=50, options={"default":""}, nullable=false) |
||
| 64 | */ |
||
| 65 | private $firstName = ''; |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @var string |
||
| 69 | * |
||
| 70 | * @ORM\Column(name="nachname", type="string", length=50, options={"default":""}, nullable=false) |
||
| 71 | */ |
||
| 72 | private $lastName = ''; |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @var string|null |
||
| 76 | * |
||
| 77 | * @ORM\Column(name="strasse", type="string", length=100, nullable=true) |
||
| 78 | */ |
||
| 79 | private $address; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @var string|null |
||
| 83 | * |
||
| 84 | * @ORM\Column(name="plz", type="string", length=8, nullable=true) |
||
| 85 | */ |
||
| 86 | private $postcode; |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @var string|null |
||
| 90 | * |
||
| 91 | * @ORM\Column(name="ort", type="string", length=100, nullable=true) |
||
| 92 | */ |
||
| 93 | private $city; |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @var string |
||
| 97 | * |
||
| 98 | * @ORM\Column(name="email", type="string", length=250, options={"default":""}, nullable=false) |
||
| 99 | */ |
||
| 100 | private $email = ''; |
||
| 101 | |||
| 102 | /** |
||
| 103 | * @var string |
||
| 104 | * |
||
| 105 | * @ORM\Column(name="phone", type="string", length=30, options={"default":""}, nullable=false) |
||
| 106 | */ |
||
| 107 | private $phone = ''; |
||
| 108 | |||
| 109 | /** |
||
| 110 | * Date of birth |
||
| 111 | * |
||
| 112 | * @var \DateTime|null |
||
| 113 | * |
||
| 114 | * @ORM\Column(name="dob", type="date", nullable=true) |
||
| 115 | */ |
||
| 116 | private $dateOfBirth; |
||
| 117 | |||
| 118 | /** |
||
| 119 | * @var string |
||
| 120 | * |
||
| 121 | * @ORM\Column(name="wikimedium_shipping", type="string", options={"default":""}, nullable=false) |
||
| 122 | */ |
||
| 123 | private $wikimediumShipping = 'none'; |
||
| 124 | |||
| 125 | /** |
||
| 126 | * @var string |
||
| 127 | * |
||
| 128 | * @ORM\Column(name="membership_type", type="string", options={"default":"sustaining"}, nullable=false) |
||
| 129 | */ |
||
| 130 | private $membershipType = 'sustaining'; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * @var integer |
||
| 134 | * |
||
| 135 | * @ORM\Column(name="membership_fee", type="integer", options={"default":0}, nullable=false) |
||
| 136 | */ |
||
| 137 | private $membershipFee = 0; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * FIXME: this should not be nullable |
||
| 141 | * |
||
| 142 | * @var integer |
||
| 143 | * |
||
| 144 | * @ORM\Column(name="membership_fee_interval", type="smallint", options={"default":12}, nullable=true) |
||
| 145 | */ |
||
| 146 | private $membershipFeeInterval = 12; |
||
| 147 | |||
| 148 | /** |
||
| 149 | * @var string |
||
| 150 | * |
||
| 151 | * @ORM\Column(name="account_number", type="string", length=16, options={"default":""}, nullable=false) |
||
| 152 | */ |
||
| 153 | private $accountNumber = ''; |
||
| 154 | |||
| 155 | /** |
||
| 156 | * @var string |
||
| 157 | * |
||
| 158 | * @ORM\Column(name="bank_name", type="string", length=50, options={"default":""}, nullable=false) |
||
| 159 | */ |
||
| 160 | private $bankName = ''; |
||
| 161 | |||
| 162 | /** |
||
| 163 | * @var string |
||
| 164 | * |
||
| 165 | * @ORM\Column(name="bank_code", type="string", length=16, options={"default":""}, nullable=false) |
||
| 166 | */ |
||
| 167 | private $bankCode = ''; |
||
| 168 | |||
| 169 | /** |
||
| 170 | * @var string|null |
||
| 171 | * |
||
| 172 | * @ORM\Column(name="iban", type="string", length=32, options={"default":""}, nullable=true) |
||
| 173 | */ |
||
| 174 | private $iban = ''; |
||
| 175 | |||
| 176 | /** |
||
| 177 | * @var string|null |
||
| 178 | * |
||
| 179 | * @ORM\Column(name="bic", type="string", length=32, options={"default":""}, nullable=true) |
||
| 180 | */ |
||
| 181 | private $bic = ''; |
||
| 182 | |||
| 183 | /** |
||
| 184 | * @var string |
||
| 185 | * |
||
| 186 | * @ORM\Column(name="account_holder", type="string", length=50, options={"default":""}, nullable=false) |
||
| 187 | */ |
||
| 188 | private $accountHolder = ''; |
||
| 189 | |||
| 190 | /** |
||
| 191 | * @var string |
||
| 192 | * |
||
| 193 | * @ORM\Column(name="comment", type="text", options={"default":""}, nullable=false) |
||
| 194 | */ |
||
| 195 | private $comment = ''; |
||
| 196 | |||
| 197 | /** |
||
| 198 | * @var \DateTime|null |
||
| 199 | * |
||
| 200 | * @ORM\Column(name="export", type="datetime", nullable=true) |
||
| 201 | */ |
||
| 202 | private $export; |
||
| 203 | |||
| 204 | /** |
||
| 205 | * @var \DateTime|null |
||
| 206 | * |
||
| 207 | * @ORM\Column(name="backup", type="datetime", nullable=true) |
||
| 208 | */ |
||
| 209 | private $backup; |
||
| 210 | |||
| 211 | /** |
||
| 212 | * @var boolean |
||
| 213 | * |
||
| 214 | * @ORM\Column(name="wikilogin", type="boolean", options={"default":0}, nullable=false) |
||
| 215 | */ |
||
| 216 | private $wikilogin = 0; |
||
| 217 | |||
| 218 | /** |
||
| 219 | * @var string|null |
||
| 220 | * |
||
| 221 | * @ORM\Column(name="tracking", type="string", length=50, nullable=true) |
||
| 222 | */ |
||
| 223 | private $tracking; |
||
| 224 | |||
| 225 | /** |
||
| 226 | * FIXME: this should not be nullable |
||
| 227 | * |
||
| 228 | * @var integer |
||
| 229 | * |
||
| 230 | * @ORM\Column(name="status", type="smallint", options={"default":0}, nullable=true) |
||
| 231 | */ |
||
| 232 | private $status = 0; |
||
| 233 | |||
| 234 | /** |
||
| 235 | * @var string|null |
||
| 236 | * |
||
| 237 | * @ORM\Column(name="country", type="string", length=8, options={"default":""}, nullable=true) |
||
| 238 | */ |
||
| 239 | private $country = ''; |
||
| 240 | |||
| 241 | /** |
||
| 242 | * @var string|null |
||
| 243 | * |
||
| 244 | * @ORM\Column(name="data", type="text", nullable=true) |
||
| 245 | */ |
||
| 246 | private $data; |
||
| 247 | |||
| 248 | /** |
||
| 249 | * @var integer |
||
| 250 | * |
||
| 251 | * @ORM\Column(name="id", type="integer") |
||
| 252 | * @ORM\Id |
||
| 253 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
| 254 | */ |
||
| 255 | private $id; |
||
| 256 | |||
| 257 | const STATUS_CONFIRMED = 1; |
||
| 258 | const STATUS_NEUTRAL = 0; |
||
| 259 | const STATUS_DELETED = -1; |
||
| 260 | const STATUS_MODERATION = -2; |
||
| 261 | const STATUS_ABORTED = -4; |
||
| 262 | const STATUS_CANCELED = -8; |
||
| 263 | |||
| 264 | /** |
||
| 265 | * @return integer |
||
| 266 | */ |
||
| 267 | public function getId() { |
||
| 270 | |||
| 271 | /** |
||
| 272 | * @since 2.0 |
||
| 273 | * |
||
| 274 | * @param integer|null $id |
||
| 275 | */ |
||
| 276 | public function setId( $id ) { |
||
| 279 | |||
| 280 | /** |
||
| 281 | * @param integer|null $donationId |
||
| 282 | * |
||
| 283 | * @return self |
||
| 284 | */ |
||
| 285 | public function setDonationId( $donationId ) { |
||
| 290 | |||
| 291 | /** |
||
| 292 | * Returns the id of the donation that led to the membership application, |
||
| 293 | * or null when the application is not linked to any donation. |
||
| 294 | * |
||
| 295 | * @return integer|null |
||
| 296 | */ |
||
| 297 | public function getDonationId() { |
||
| 300 | |||
| 301 | /** |
||
| 302 | * @param \DateTime $timestamp |
||
| 303 | * |
||
| 304 | * @return self |
||
| 305 | */ |
||
| 306 | public function setTimestamp( $timestamp ) { |
||
| 311 | |||
| 312 | /** |
||
| 313 | * @return \DateTime |
||
| 314 | */ |
||
| 315 | public function getTimestamp() { |
||
| 318 | |||
| 319 | /** |
||
| 320 | * @param string|null $salutation |
||
| 321 | * |
||
| 322 | * @return self |
||
| 323 | */ |
||
| 324 | public function setSalutation( $salutation ) { |
||
| 329 | |||
| 330 | /** |
||
| 331 | * @return string|null |
||
| 332 | */ |
||
| 333 | public function getSalutation() { |
||
| 336 | |||
| 337 | /** |
||
| 338 | * @param string|null $company |
||
| 339 | * |
||
| 340 | * @return self |
||
| 341 | */ |
||
| 342 | public function setCompany( $company ) { |
||
| 347 | |||
| 348 | /** |
||
| 349 | * @return string|null |
||
| 350 | */ |
||
| 351 | public function getCompany() { |
||
| 354 | |||
| 355 | /** |
||
| 356 | * @param string $title |
||
| 357 | * |
||
| 358 | * @return self |
||
| 359 | */ |
||
| 360 | public function setTitle( $title ) { |
||
| 365 | |||
| 366 | /** |
||
| 367 | * @return string |
||
| 368 | */ |
||
| 369 | public function getTitle() { |
||
| 372 | |||
| 373 | /** |
||
| 374 | * @param string $name |
||
| 375 | * |
||
| 376 | * @return self |
||
| 377 | */ |
||
| 378 | public function setName( $name ) { |
||
| 383 | |||
| 384 | /** |
||
| 385 | * @return string |
||
| 386 | */ |
||
| 387 | public function getName() { |
||
| 390 | |||
| 391 | /** |
||
| 392 | * @param string $firstName |
||
| 393 | * |
||
| 394 | * @return self |
||
| 395 | */ |
||
| 396 | public function setFirstName( $firstName ) { |
||
| 402 | |||
| 403 | /** |
||
| 404 | * @return string |
||
| 405 | */ |
||
| 406 | public function getFirstName() { |
||
| 409 | |||
| 410 | /** |
||
| 411 | * @param string $lastName |
||
| 412 | * |
||
| 413 | * @return self |
||
| 414 | */ |
||
| 415 | public function setLastName( $lastName ) { |
||
| 421 | |||
| 422 | /** |
||
| 423 | * @return string |
||
| 424 | */ |
||
| 425 | public function getLastName() { |
||
| 428 | |||
| 429 | /** |
||
| 430 | * Sets the full name |
||
| 431 | */ |
||
| 432 | public function setNameFromParts( $vorname, $nachname) { |
||
| 438 | |||
| 439 | /** |
||
| 440 | * Set address (street, etc) |
||
| 441 | * |
||
| 442 | * @param string|null $address |
||
| 443 | * |
||
| 444 | * @return self |
||
| 445 | */ |
||
| 446 | public function setAddress( $address ) { |
||
| 451 | |||
| 452 | /** |
||
| 453 | * Get address (street, etc) |
||
| 454 | * |
||
| 455 | * @return string|null |
||
| 456 | */ |
||
| 457 | public function getAddress() { |
||
| 460 | |||
| 461 | /** |
||
| 462 | * @param string|null $postcode |
||
| 463 | * |
||
| 464 | * @return self |
||
| 465 | */ |
||
| 466 | public function setPostcode( $postcode ) { |
||
| 471 | |||
| 472 | /** |
||
| 473 | * @return string|null |
||
| 474 | */ |
||
| 475 | public function getPostcode() { |
||
| 478 | |||
| 479 | /** |
||
| 480 | * @param string|null $city |
||
| 481 | * |
||
| 482 | * @return self |
||
| 483 | */ |
||
| 484 | public function setCity( $city ) { |
||
| 489 | |||
| 490 | /** |
||
| 491 | * @return string|null |
||
| 492 | */ |
||
| 493 | public function getCity() { |
||
| 496 | |||
| 497 | /** |
||
| 498 | * Set email |
||
| 499 | * |
||
| 500 | * @param string $email |
||
| 501 | * |
||
| 502 | * @return self |
||
| 503 | */ |
||
| 504 | public function setEmail( $email ) { |
||
| 509 | |||
| 510 | /** |
||
| 511 | * Get email |
||
| 512 | * |
||
| 513 | * @return string |
||
| 514 | */ |
||
| 515 | public function getEmail() { |
||
| 518 | |||
| 519 | /** |
||
| 520 | * Set phone |
||
| 521 | * |
||
| 522 | * @param string $phone |
||
| 523 | * |
||
| 524 | * @return self |
||
| 525 | */ |
||
| 526 | public function setPhone( $phone ) { |
||
| 531 | |||
| 532 | /** |
||
| 533 | * Get phone |
||
| 534 | * |
||
| 535 | * @return string |
||
| 536 | */ |
||
| 537 | public function getPhone() { |
||
| 540 | |||
| 541 | /** |
||
| 542 | * Sets the date of birth of the applicant |
||
| 543 | * |
||
| 544 | * @param \DateTime|null $dateOfBirth |
||
| 545 | * |
||
| 546 | * @return self |
||
| 547 | */ |
||
| 548 | public function setDob( $dateOfBirth ) { |
||
| 553 | |||
| 554 | /** |
||
| 555 | * Returns the date of birth of the applicant |
||
| 556 | * |
||
| 557 | * @return \DateTime|null |
||
| 558 | */ |
||
| 559 | public function getDob() { |
||
| 562 | |||
| 563 | /** |
||
| 564 | * @param string $wikimediumShipping |
||
| 565 | * |
||
| 566 | * @return self |
||
| 567 | */ |
||
| 568 | public function setWikimediumShipping( $wikimediumShipping ) { |
||
| 573 | |||
| 574 | /** |
||
| 575 | * @return string |
||
| 576 | */ |
||
| 577 | public function getWikimediumShipping() { |
||
| 580 | |||
| 581 | /** |
||
| 582 | * @param string $membershipType |
||
| 583 | * |
||
| 584 | * @return self |
||
| 585 | */ |
||
| 586 | public function setMembershipType( $membershipType ) { |
||
| 591 | |||
| 592 | /** |
||
| 593 | * @return string |
||
| 594 | */ |
||
| 595 | public function getMembershipType() { |
||
| 598 | |||
| 599 | /** |
||
| 600 | * @param integer $membershipFee |
||
| 601 | * |
||
| 602 | * @return self |
||
| 603 | */ |
||
| 604 | public function setMembershipFee( $membershipFee ) { |
||
| 609 | |||
| 610 | /** |
||
| 611 | * @return integer |
||
| 612 | */ |
||
| 613 | public function getMembershipFee() { |
||
| 616 | |||
| 617 | /** |
||
| 618 | * @param integer $membershipFeeInterval |
||
| 619 | * |
||
| 620 | * @return self |
||
| 621 | */ |
||
| 622 | public function setMembershipFeeInterval($membershipFeeInterval) { |
||
| 627 | |||
| 628 | /** |
||
| 629 | * @return integer |
||
| 630 | */ |
||
| 631 | public function getMembershipFeeInterval() { |
||
| 634 | |||
| 635 | |||
| 636 | /** |
||
| 637 | * @param string $accountNumber |
||
| 638 | * |
||
| 639 | * @return self |
||
| 640 | */ |
||
| 641 | public function setAccountNumber( $accountNumber ) { |
||
| 646 | |||
| 647 | /** |
||
| 648 | * @return string |
||
| 649 | */ |
||
| 650 | public function getAccountNumber() { |
||
| 653 | |||
| 654 | /** |
||
| 655 | * @param string $bankName |
||
| 656 | * |
||
| 657 | * @return self |
||
| 658 | */ |
||
| 659 | public function setBankName( $bankName ) { |
||
| 664 | |||
| 665 | /** |
||
| 666 | * @return string |
||
| 667 | */ |
||
| 668 | public function getBankName() { |
||
| 671 | |||
| 672 | /** |
||
| 673 | * @param string $bankCode |
||
| 674 | * |
||
| 675 | * @return self |
||
| 676 | */ |
||
| 677 | public function setBankCode( $bankCode ) { |
||
| 682 | |||
| 683 | /** |
||
| 684 | * @return string |
||
| 685 | */ |
||
| 686 | public function getBankCode() { |
||
| 689 | |||
| 690 | /** |
||
| 691 | * @param string|null $iban |
||
| 692 | * |
||
| 693 | * @return self |
||
| 694 | */ |
||
| 695 | public function setIban( $iban ) { |
||
| 700 | |||
| 701 | /** |
||
| 702 | * @return string|null |
||
| 703 | */ |
||
| 704 | public function getIban() { |
||
| 707 | |||
| 708 | /** |
||
| 709 | * @param string|null $bic |
||
| 710 | * |
||
| 711 | * @return self |
||
| 712 | */ |
||
| 713 | public function setBic( $bic ) { |
||
| 718 | |||
| 719 | /** |
||
| 720 | * @return string|null |
||
| 721 | */ |
||
| 722 | public function getBic() { |
||
| 725 | |||
| 726 | /** |
||
| 727 | * @param string $accountHolder |
||
| 728 | * |
||
| 729 | * @return self |
||
| 730 | */ |
||
| 731 | public function setAccountHolder( $accountHolder ) { |
||
| 736 | |||
| 737 | /** |
||
| 738 | * @return string |
||
| 739 | */ |
||
| 740 | public function getAccountHolder() { |
||
| 743 | |||
| 744 | /** |
||
| 745 | * @param string $comment |
||
| 746 | * |
||
| 747 | * @return self |
||
| 748 | */ |
||
| 749 | public function setComment( $comment ) { |
||
| 754 | |||
| 755 | /** |
||
| 756 | * @return string |
||
| 757 | */ |
||
| 758 | public function getComment() { |
||
| 761 | |||
| 762 | /** |
||
| 763 | * Sets the time of export. |
||
| 764 | * |
||
| 765 | * @param \DateTime|null $export |
||
| 766 | * |
||
| 767 | * @return self |
||
| 768 | */ |
||
| 769 | public function setExport( $export ) { |
||
| 774 | |||
| 775 | /** |
||
| 776 | * Returns the time of export. |
||
| 777 | * |
||
| 778 | * @return \DateTime|null |
||
| 779 | */ |
||
| 780 | public function getExport() { |
||
| 783 | |||
| 784 | /** |
||
| 785 | * Sets the time of backup. |
||
| 786 | * |
||
| 787 | * @param \DateTime|null $backup |
||
| 788 | * |
||
| 789 | * @return self |
||
| 790 | */ |
||
| 791 | public function setBackup( $backup ) { |
||
| 796 | |||
| 797 | /** |
||
| 798 | * Returns the time of backup. |
||
| 799 | * |
||
| 800 | * @return \DateTime|null |
||
| 801 | */ |
||
| 802 | public function getBackup() { |
||
| 805 | |||
| 806 | /** |
||
| 807 | * @param boolean $wikilogin |
||
| 808 | * |
||
| 809 | * @return self |
||
| 810 | */ |
||
| 811 | public function setWikilogin( $wikilogin ) { |
||
| 816 | |||
| 817 | /** |
||
| 818 | * @return boolean |
||
| 819 | */ |
||
| 820 | public function getWikilogin() { |
||
| 823 | |||
| 824 | /** |
||
| 825 | * @param string|null $tracking |
||
| 826 | * |
||
| 827 | * @return self |
||
| 828 | */ |
||
| 829 | public function setTracking( $tracking ) { |
||
| 834 | |||
| 835 | /** |
||
| 836 | * @return string|null |
||
| 837 | */ |
||
| 838 | public function getTracking() { |
||
| 841 | |||
| 842 | /** |
||
| 843 | * Sets the status of the membership request. |
||
| 844 | * The allowed values are the STATUS_ constants in this class. |
||
| 845 | * |
||
| 846 | * @param integer $status |
||
| 847 | * |
||
| 848 | * @return self |
||
| 849 | */ |
||
| 850 | public function setStatus( $status ) { |
||
| 855 | |||
| 856 | /** |
||
| 857 | * Returns the status of the membership request. |
||
| 858 | * The possible values are the STATUS_ constants in this class. |
||
| 859 | * |
||
| 860 | * @return integer |
||
| 861 | */ |
||
| 862 | public function getStatus() { |
||
| 865 | |||
| 866 | /** |
||
| 867 | * @param string|null $country |
||
| 868 | * |
||
| 869 | * @return self |
||
| 870 | */ |
||
| 871 | public function setCountry( $country ) { |
||
| 876 | |||
| 877 | /** |
||
| 878 | * @return string|null |
||
| 879 | */ |
||
| 880 | public function getCountry() { |
||
| 883 | |||
| 884 | /** |
||
| 885 | * @param string|null $data |
||
| 886 | * @return self |
||
| 887 | */ |
||
| 888 | public function setData( $data ) { |
||
| 893 | |||
| 894 | /** |
||
| 895 | * @return string|null |
||
| 896 | */ |
||
| 897 | public function getData() { |
||
| 900 | |||
| 901 | public function isUnconfirmed() { |
||
| 904 | |||
| 905 | public function log( $message ) { |
||
| 912 | |||
| 913 | /** |
||
| 914 | * NOTE: if possible, use @see getDataObject instead, as it provides a nicer API. |
||
| 915 | * |
||
| 916 | * @since 2.0 |
||
| 917 | * @return array |
||
| 918 | */ |
||
| 919 | public function getDecodedData() { |
||
| 924 | |||
| 925 | /** |
||
| 926 | * NOTE: if possible, use @see modifyDataObject instead, as it provides a nicer API. |
||
| 927 | * |
||
| 928 | * @since 2.0 |
||
| 929 | * @param array $data |
||
|
|
|||
| 930 | */ |
||
| 931 | public function encodeAndSetData( array $dataArray ) { |
||
| 934 | |||
| 935 | /** |
||
| 936 | * WARNING: updates made to the return value will not be reflected in the Donation state. |
||
| 937 | * Similarly, updates to the Donation state will not propagate to the returned object. |
||
| 938 | * To update the Donation state, explicitly call @see setDataObject. |
||
| 939 | * |
||
| 940 | * @since 2.0 |
||
| 941 | * @return MembershipApplicationData |
||
| 942 | */ |
||
| 943 | public function getDataObject() { |
||
| 953 | |||
| 954 | /** |
||
| 955 | * @since 2.0 |
||
| 956 | * @param MembershipApplicationData $data |
||
| 957 | */ |
||
| 958 | public function setDataObject( MembershipApplicationData $data ) { |
||
| 975 | |||
| 976 | /** |
||
| 977 | * @since 2.0 |
||
| 978 | * @param callable $modificationFunction Takes a modifiable MembershipApplicationData parameter |
||
| 979 | */ |
||
| 980 | public function modifyDataObject( callable $modificationFunction ) { |
||
| 985 | |||
| 986 | } |
||
| 987 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.