Complex classes like JobSnapshot 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 JobSnapshot, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 33 | class JobSnapshot extends BaseEntity implements JobInterface, SnapshotInterface |
||
| 34 | { |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var String |
||
| 38 | */ |
||
| 39 | protected $jobId; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * unique ID of a job posting used by applications to reference |
||
| 43 | * a job |
||
| 44 | * |
||
| 45 | * @var String |
||
| 46 | * @ODM\Field(type="string") @ODM\Index |
||
| 47 | **/ |
||
| 48 | protected $applyId; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * title of a job posting |
||
| 52 | * |
||
| 53 | * @var String |
||
| 54 | * @ODM\Field(type="string") |
||
| 55 | */ |
||
| 56 | protected $title; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * name of the publishing company |
||
| 60 | * |
||
| 61 | * @var String |
||
| 62 | * @ODM\Field(type="string") |
||
| 63 | */ |
||
| 64 | protected $company; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * publishing company |
||
| 68 | * |
||
| 69 | * @var OrganizationInterface |
||
| 70 | * @ODM\ReferenceOne (targetDocument="\Organizations\Entity\Organization", simple=true, inversedBy="jobs") |
||
| 71 | * @ODM\Index |
||
| 72 | */ |
||
| 73 | protected $organization; |
||
| 74 | |||
| 75 | |||
| 76 | /** |
||
| 77 | * Email Address, which is used to send notifications about e.g. new applications. |
||
| 78 | * |
||
| 79 | * @var String |
||
| 80 | * @ODM\Field(type="string") |
||
| 81 | **/ |
||
| 82 | protected $contactEmail; |
||
| 83 | |||
| 84 | /** |
||
| 85 | * the owner of a Job Posting |
||
| 86 | * |
||
| 87 | * @var UserInterface $user |
||
| 88 | * @ODM\ReferenceOne(targetDocument="\Auth\Entity\User", simple=true) |
||
| 89 | * @ODM\Index |
||
| 90 | */ |
||
| 91 | protected $user; |
||
| 92 | |||
| 93 | /** |
||
| 94 | * all applications of a certain jobad |
||
| 95 | * |
||
| 96 | * @var Collection |
||
| 97 | * @ODM\ReferenceMany(targetDocument="Applications\Entity\Application", simple=true, mappedBy="job", |
||
| 98 | * repositoryMethod="loadApplicationsForJob") |
||
| 99 | */ |
||
| 100 | protected $applications; |
||
| 101 | |||
| 102 | /** |
||
| 103 | * new applications |
||
| 104 | * |
||
| 105 | * @ODM\ReferenceMany(targetDocument="Applications\Entity\Application", |
||
| 106 | * repositoryMethod="loadUnreadApplicationsForJob", mappedBy="job") |
||
| 107 | * @var Int |
||
| 108 | */ |
||
| 109 | protected $unreadApplications; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * language of the job posting. Languages are ISO 639-1 coded |
||
| 113 | * |
||
| 114 | * @var String |
||
| 115 | * @ODM\Field(type="string") |
||
| 116 | */ |
||
| 117 | protected $language; |
||
| 118 | |||
| 119 | /** |
||
| 120 | * location of the job posting. This is a plain text, which describes the location in |
||
| 121 | * search e.g. results. |
||
| 122 | * |
||
| 123 | * @var String |
||
| 124 | * @ODM\Field(type="string") |
||
| 125 | */ |
||
| 126 | protected $location; |
||
| 127 | |||
| 128 | /** |
||
| 129 | * locations of the job posting. This collection contains structured coordinates, |
||
| 130 | * postal codes, city, region, and country names |
||
| 131 | * |
||
| 132 | * @var Collection |
||
| 133 | * @ODM\EmbedMany(targetDocument="Location") |
||
| 134 | */ |
||
| 135 | protected $locations; |
||
| 136 | |||
| 137 | /** |
||
| 138 | * Link which points to the job posting |
||
| 139 | * |
||
| 140 | * @var String |
||
| 141 | * @ODM\Field(type="string") |
||
| 142 | **/ |
||
| 143 | protected $link; |
||
| 144 | |||
| 145 | /** |
||
| 146 | * publishing date of a job posting |
||
| 147 | * |
||
| 148 | * @var String |
||
| 149 | * @ODM\Field(type="tz_date") |
||
| 150 | */ |
||
| 151 | protected $datePublishStart; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * end date of a job posting |
||
| 155 | * |
||
| 156 | * @var String |
||
| 157 | * @ODM\Field(type="tz_date") |
||
| 158 | */ |
||
| 159 | protected $datePublishEnd; |
||
| 160 | |||
| 161 | /** |
||
| 162 | * Status of the job posting |
||
| 163 | * |
||
| 164 | * @var Status |
||
| 165 | * @ODM\EmbedOne(targetDocument="Status") |
||
| 166 | * @ODM\Index |
||
| 167 | */ |
||
| 168 | protected $status; |
||
| 169 | |||
| 170 | /** |
||
| 171 | * History on an job posting |
||
| 172 | * |
||
| 173 | * @var Collection |
||
| 174 | * @ODM\EmbedMany(targetDocument="History") |
||
| 175 | */ |
||
| 176 | protected $history; |
||
| 177 | |||
| 178 | /** |
||
| 179 | * Flag, privacy policy is accepted or not. |
||
| 180 | * |
||
| 181 | * @var bool |
||
| 182 | * @ODM\Boolean |
||
| 183 | */ |
||
| 184 | protected $termsAccepted; |
||
| 185 | |||
| 186 | /** |
||
| 187 | * Reference of a job opening, on which an applicant can refer to. |
||
| 188 | * |
||
| 189 | * @var String |
||
| 190 | * @ODM\Field(type="string") |
||
| 191 | */ |
||
| 192 | protected $reference; |
||
| 193 | |||
| 194 | /** |
||
| 195 | * Unified Resource Locator to the company-Logo |
||
| 196 | * |
||
| 197 | * @deprecated (use $organization->image->uri instead) |
||
| 198 | * @var String |
||
| 199 | * @ODM\Field(type="string") |
||
| 200 | */ |
||
| 201 | protected $logoRef; |
||
| 202 | |||
| 203 | /** |
||
| 204 | * Template-Name |
||
| 205 | * |
||
| 206 | * @var String |
||
| 207 | * @ODM\Field(type="string") |
||
| 208 | */ |
||
| 209 | protected $template; |
||
| 210 | |||
| 211 | /** |
||
| 212 | * Application link. |
||
| 213 | * |
||
| 214 | * @var String |
||
| 215 | * @ODM\Field(type="string") |
||
| 216 | */ |
||
| 217 | protected $uriApply; |
||
| 218 | |||
| 219 | /** |
||
| 220 | * Unified Resource Locator the Yawik, which handled this job first - so |
||
| 221 | * does know who is the one who has commited this job. |
||
| 222 | * |
||
| 223 | * @var String |
||
| 224 | * @ODM\Field(type="string") |
||
| 225 | */ |
||
| 226 | protected $uriPublisher; |
||
| 227 | |||
| 228 | /** |
||
| 229 | * The ATS mode entity. |
||
| 230 | * |
||
| 231 | * @var AtsMode |
||
| 232 | * @ODM\EmbedOne(targetDocument="AtsMode") |
||
| 233 | */ |
||
| 234 | protected $atsMode; |
||
| 235 | |||
| 236 | /** |
||
| 237 | * this must be enabled to use applications forms etc. for this job or |
||
| 238 | * to see number of applications in the list of applications |
||
| 239 | * |
||
| 240 | * @var Boolean |
||
| 241 | * |
||
| 242 | * @ODM\Boolean |
||
| 243 | */ |
||
| 244 | protected $atsEnabled; |
||
| 245 | |||
| 246 | /** |
||
| 247 | * Permissions |
||
| 248 | * |
||
| 249 | * @var PermissionsInterface |
||
| 250 | * @ODM\EmbedOne(targetDocument="\Core\Entity\Permissions") |
||
| 251 | */ |
||
| 252 | protected $permissions; |
||
| 253 | |||
| 254 | /** |
||
| 255 | * |
||
| 256 | * @var TemplateValues |
||
| 257 | * @ODM\EmbedOne(targetDocument="\Jobs\Entity\TemplateValues") |
||
| 258 | */ |
||
| 259 | protected $templateValues; |
||
| 260 | |||
| 261 | |||
| 262 | /** |
||
| 263 | * Can contain various Portals |
||
| 264 | * |
||
| 265 | * @var array |
||
| 266 | * @ODM\Collection*/ |
||
| 267 | protected $portals = array(); |
||
| 268 | |||
| 269 | /** |
||
| 270 | * Flag indicating draft state of this job. |
||
| 271 | * |
||
| 272 | * @var bool |
||
| 273 | * @ODM\Boolean |
||
| 274 | */ |
||
| 275 | protected $isDraft = false; |
||
| 276 | |||
| 277 | /** |
||
| 278 | * @param $jobEntity |
||
| 279 | */ |
||
| 280 | public function __construct() |
||
| 283 | |||
| 284 | /** |
||
| 285 | * transfer all attributes from the job-entity to the snapshot-entity |
||
| 286 | * |
||
| 287 | * @TODO this could go into an abstract class since it is nearly allways the same |
||
| 288 | * |
||
| 289 | * @param $source |
||
| 290 | * @param $target |
||
| 291 | * @return $this |
||
| 292 | */ |
||
| 293 | protected function copyAttributes($source, $target) |
||
| 320 | |||
| 321 | |||
| 322 | |||
| 323 | /** |
||
| 324 | * Gets the unique key used by applications to reference a job posting |
||
| 325 | * |
||
| 326 | * @param string $applyId |
||
| 327 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 328 | */ |
||
| 329 | public function setApplyId($applyId) |
||
| 333 | |||
| 334 | /** |
||
| 335 | * Sets a unique key used by applications to reference a job posting |
||
| 336 | * |
||
| 337 | * @return string |
||
| 338 | */ |
||
| 339 | public function getApplyId() |
||
| 343 | |||
| 344 | /** |
||
| 345 | * checks, weather a job is enabled for getting applications |
||
| 346 | * @deprecated since 0.19 - Use atsMode sub document via getAtsMode() |
||
| 347 | * @return boolean |
||
| 348 | */ |
||
| 349 | public function getAtsEnabled() |
||
| 353 | |||
| 354 | /** |
||
| 355 | * enables a job add to receive applications |
||
| 356 | * |
||
| 357 | * @param boolean $atsEnabled |
||
| 358 | * @deprecated since 0.19 - Use atsMode entity via setAtsMode() |
||
| 359 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 360 | * @return \Jobs\Entity\Job |
||
| 361 | */ |
||
| 362 | public function setAtsEnabled($atsEnabled) |
||
| 366 | |||
| 367 | /** |
||
| 368 | * Sets the ATS mode. |
||
| 369 | * |
||
| 370 | * @param AtsMode $mode |
||
| 371 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 372 | * |
||
| 373 | * @return self |
||
| 374 | * @since 0.19 |
||
| 375 | */ |
||
| 376 | public function setAtsMode(AtsMode $mode) |
||
| 380 | |||
| 381 | /** |
||
| 382 | * Gets the ATS mode. |
||
| 383 | * |
||
| 384 | * @return AtsMode |
||
| 385 | * @since 0.19 |
||
| 386 | */ |
||
| 387 | public function getAtsMode() |
||
| 391 | |||
| 392 | /** |
||
| 393 | * Gets an URI for a job posting |
||
| 394 | * |
||
| 395 | * @return string |
||
| 396 | */ |
||
| 397 | public function getLink() |
||
| 401 | |||
| 402 | /** |
||
| 403 | * Sets an URI for a job posting |
||
| 404 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 405 | * |
||
| 406 | * @param string $link |
||
| 407 | */ |
||
| 408 | public function setLink($link) |
||
| 412 | |||
| 413 | /** |
||
| 414 | * Gets the publishing date of a job posting |
||
| 415 | * |
||
| 416 | * @return string |
||
| 417 | */ |
||
| 418 | public function getDatePublishStart() |
||
| 422 | |||
| 423 | /** |
||
| 424 | * Sets the publishing date of a job posting |
||
| 425 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 426 | * |
||
| 427 | * @param $datePublishStart |
||
| 428 | * @return string |
||
| 429 | */ |
||
| 430 | public function setDatePublishStart($datePublishStart) |
||
| 434 | |||
| 435 | /** |
||
| 436 | * Gets the end date for publishing of a job posting |
||
| 437 | * |
||
| 438 | * @return string |
||
| 439 | */ |
||
| 440 | public function getDatePublishEnd() |
||
| 444 | |||
| 445 | /** |
||
| 446 | * Sets the publishing date of a job posting |
||
| 447 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 448 | * |
||
| 449 | * @param $datePublishStart |
||
| 450 | * @return string |
||
| 451 | */ |
||
| 452 | public function setDatePublishEnd($datePublishEnd) |
||
| 456 | |||
| 457 | /** |
||
| 458 | * Gets the title of a job posting |
||
| 459 | * |
||
| 460 | * @return string $title |
||
| 461 | */ |
||
| 462 | public function getTitle() |
||
| 466 | |||
| 467 | /** |
||
| 468 | * Sets the title of a job posting |
||
| 469 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 470 | * |
||
| 471 | * @param string $title |
||
| 472 | */ |
||
| 473 | public function setTitle($title) |
||
| 477 | |||
| 478 | /** |
||
| 479 | * Gets the organisation name, which offers the job posting |
||
| 480 | * |
||
| 481 | * @deprecated |
||
| 482 | * @return string |
||
| 483 | */ |
||
| 484 | public function getCompany() |
||
| 488 | |||
| 489 | /** |
||
| 490 | * Sets the organisation name, which offers a job posting |
||
| 491 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 492 | * |
||
| 493 | * @deprecated |
||
| 494 | * @param string $company |
||
| 495 | * @return JobInterface $job |
||
| 496 | */ |
||
| 497 | public function setCompany($company) |
||
| 501 | |||
| 502 | /** |
||
| 503 | * Gets the organisation, which offers the job posting |
||
| 504 | * |
||
| 505 | * @return OrganizationInterface |
||
| 506 | */ |
||
| 507 | public function getOrganization() |
||
| 511 | |||
| 512 | /** |
||
| 513 | * Sets the organization, which offers the job |
||
| 514 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 515 | * |
||
| 516 | * @param OrganizationInterface $organization |
||
|
|
|||
| 517 | * @return JobInterface |
||
| 518 | */ |
||
| 519 | public function setOrganization(OrganizationInterface $organization = null) |
||
| 523 | |||
| 524 | /** |
||
| 525 | * Sets the contact email of a job posting |
||
| 526 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 527 | * |
||
| 528 | * @param string $email |
||
| 529 | * @return JobInterface $job |
||
| 530 | */ |
||
| 531 | public function setContactEmail($email) |
||
| 535 | |||
| 536 | /** |
||
| 537 | * Gets the contact email a job posting |
||
| 538 | * |
||
| 539 | * @return string |
||
| 540 | */ |
||
| 541 | public function getContactEmail() |
||
| 545 | |||
| 546 | /** |
||
| 547 | * Sets the user, who owns a job posting |
||
| 548 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 549 | * |
||
| 550 | * @param UserInterface $user |
||
| 551 | * @return JobInterface $job |
||
| 552 | */ |
||
| 553 | public function setUser(UserInterface $user) |
||
| 557 | |||
| 558 | /** |
||
| 559 | * Gets the user, who owns a job posting |
||
| 560 | * |
||
| 561 | * @return UserInterface $user |
||
| 562 | */ |
||
| 563 | public function getUser() |
||
| 567 | |||
| 568 | /** |
||
| 569 | * Gets the link to the application form |
||
| 570 | * |
||
| 571 | * @return String |
||
| 572 | */ |
||
| 573 | public function getUriApply() |
||
| 577 | |||
| 578 | /** |
||
| 579 | * Sets the Link to the application form |
||
| 580 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 581 | * |
||
| 582 | * @param String $uriApply |
||
| 583 | * @return \Jobs\Entity\Job |
||
| 584 | */ |
||
| 585 | public function setUriApply($uriApply) |
||
| 589 | |||
| 590 | /** |
||
| 591 | * Gets the URI of the publisher |
||
| 592 | * |
||
| 593 | * @return String |
||
| 594 | */ |
||
| 595 | public function getUriPublisher() |
||
| 599 | |||
| 600 | /** |
||
| 601 | * Sets the URI of the publisher |
||
| 602 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 603 | * |
||
| 604 | * @param String $uriPublisher |
||
| 605 | * @return \Jobs\Entity\Job |
||
| 606 | */ |
||
| 607 | public function setUriPublisher($uriPublisher) |
||
| 611 | |||
| 612 | /** |
||
| 613 | * Sets the language of a job posting |
||
| 614 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 615 | * |
||
| 616 | * @param string $language |
||
| 617 | */ |
||
| 618 | public function setLanguage($language) |
||
| 622 | |||
| 623 | /** |
||
| 624 | * Gets the language of a job posting |
||
| 625 | * |
||
| 626 | * @return string |
||
| 627 | */ |
||
| 628 | public function getLanguage() |
||
| 632 | |||
| 633 | /** |
||
| 634 | * Sets the location of a job posting |
||
| 635 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 636 | * |
||
| 637 | * @param string $location |
||
| 638 | */ |
||
| 639 | public function setLocation($location) |
||
| 643 | |||
| 644 | /** |
||
| 645 | * Gets the location of a job posting |
||
| 646 | * |
||
| 647 | * @return string |
||
| 648 | */ |
||
| 649 | public function getLocation() |
||
| 653 | |||
| 654 | /** |
||
| 655 | * Sets locations of a job posting |
||
| 656 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 657 | * |
||
| 658 | * @param string $locations |
||
| 659 | */ |
||
| 660 | public function setLocations($locations) |
||
| 664 | |||
| 665 | /** |
||
| 666 | * Gets locations of a job posting |
||
| 667 | * |
||
| 668 | * @return string |
||
| 669 | */ |
||
| 670 | public function getLocations() |
||
| 674 | |||
| 675 | /** |
||
| 676 | * Sets applications for a job posting |
||
| 677 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 678 | * |
||
| 679 | * @param Collection $applications |
||
| 680 | */ |
||
| 681 | public function setApplications(Collection $applications) |
||
| 685 | |||
| 686 | /** |
||
| 687 | * Gets applications for a job posting |
||
| 688 | * |
||
| 689 | * @return Collection $applications |
||
| 690 | */ |
||
| 691 | public function getApplications() |
||
| 695 | |||
| 696 | /** |
||
| 697 | * Sets Status of a job posting |
||
| 698 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 699 | * |
||
| 700 | * @param string $status |
||
| 701 | */ |
||
| 702 | public function setStatus($status) |
||
| 706 | |||
| 707 | /** |
||
| 708 | * Gets applications for a job posting |
||
| 709 | * |
||
| 710 | * @return string |
||
| 711 | */ |
||
| 712 | public function getStatus() |
||
| 716 | |||
| 717 | /** |
||
| 718 | * Sets the collection of history entities. |
||
| 719 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 720 | * |
||
| 721 | * @param Collection $history |
||
| 722 | * @return JobInterface |
||
| 723 | */ |
||
| 724 | public function setHistory(Collection $history) |
||
| 728 | |||
| 729 | /** |
||
| 730 | * Gets the collection of history entities. |
||
| 731 | * |
||
| 732 | * @return Collection |
||
| 733 | */ |
||
| 734 | public function getHistory() |
||
| 738 | |||
| 739 | /** |
||
| 740 | * Sets the terms and conditions accepted flag. |
||
| 741 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 742 | * |
||
| 743 | * @param bool $flag |
||
| 744 | * @return self |
||
| 745 | */ |
||
| 746 | public function setTermsAccepted($flag) |
||
| 750 | |||
| 751 | /** |
||
| 752 | * Gets the terms and conditions accepted flag. |
||
| 753 | * |
||
| 754 | * @return bool |
||
| 755 | */ |
||
| 756 | public function getTermsAccepted() |
||
| 760 | |||
| 761 | /** |
||
| 762 | * Sets a reference for a job posting, used by the |
||
| 763 | * organisation offering the job. |
||
| 764 | * |
||
| 765 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 766 | * @param string $reference |
||
| 767 | */ |
||
| 768 | public function setReference($reference) |
||
| 772 | |||
| 773 | /** |
||
| 774 | * Gets a reference for a job posting, used by the |
||
| 775 | * organisation offering the job. |
||
| 776 | * |
||
| 777 | * @return string $reference |
||
| 778 | */ |
||
| 779 | public function getReference() |
||
| 783 | |||
| 784 | /** |
||
| 785 | * Sets the list of channels where a job opening should be published |
||
| 786 | * |
||
| 787 | * @throws \Core\Exception\ImmutablePropertyException |
||
| 788 | * @param Array $portals |
||
| 789 | */ |
||
| 790 | public function setPortals(array $portals) |
||
| 794 | |||
| 795 | /** |
||
| 796 | * Gets the list of channels where the job opening should be published |
||
| 797 | * |
||
| 798 | * @return Array |
||
| 799 | */ |
||
| 800 | public function getPortals() |
||
| 804 | |||
| 805 | /** |
||
| 806 | * Gets the permissions entity. |
||
| 807 | * |
||
| 808 | * @return PermissionsInterface |
||
| 809 | */ |
||
| 810 | public function getPermissions() |
||
| 814 | |||
| 815 | /** |
||
| 816 | * the permissions must be mutable because of a flaw in the design of an upper class |
||
| 817 | * |
||
| 818 | * @param PermissionsInterface $permissions |
||
| 819 | * @return $this |
||
| 820 | */ |
||
| 821 | public function setPermissions(PermissionsInterface $permissions) |
||
| 826 | |||
| 827 | /** |
||
| 828 | * Gets the Values of a job template |
||
| 829 | * |
||
| 830 | * @return TemplateValues |
||
| 831 | */ |
||
| 832 | public function getTemplateValues() |
||
| 836 | |||
| 837 | /** |
||
| 838 | * @param EntityInterface $templateValues |
||
| 839 | * @return $this |
||
| 840 | */ |
||
| 841 | public function setTemplateValues(EntityInterface $templateValues = null) |
||
| 846 | |||
| 847 | /** |
||
| 848 | * Returns the string identifier of the Resource |
||
| 849 | * |
||
| 850 | * @return null|string |
||
| 851 | */ |
||
| 852 | public function getResourceId() |
||
| 856 | } |
||
| 857 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.