Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like ObjectService 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 ObjectService, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 37 | class ObjectService extends AbstractBrowserBindingService implements ObjectServiceInterface |
||
| 38 | { |
||
| 39 | /** |
||
| 40 | * L1 cache for objects. Fills with two levels: |
||
| 41 | * |
||
| 42 | * - First level key is the object ID, path or other singular identifier of object(s) |
||
| 43 | * - Second level key is a hash of context arguments used to retrieve the object(s) |
||
| 44 | * |
||
| 45 | * @var array |
||
| 46 | */ |
||
| 47 | protected $objectCache = array(); |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Appends the content stream to the content of the document. |
||
| 51 | * |
||
| 52 | * The stream in contentStream is consumed but not closed by this method. |
||
| 53 | * |
||
| 54 | * @param string $repositoryId the identifier for the repository |
||
| 55 | * @param string $objectId The identifier for the object. The repository might return a different/new object id |
||
| 56 | * @param StreamInterface $contentStream The content stream to append |
||
| 57 | * @param boolean $isLastChunk Indicates if this content stream is the last chunk |
||
| 58 | * @param string|null $changeToken The last change token of this object that the client received. |
||
| 59 | * The repository might return a new change token (default is <code>null</code>) |
||
| 60 | * @param ExtensionDataInterface|null $extension |
||
| 61 | */ |
||
| 62 | public function appendContentStream( |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Updates properties and secondary types of one or more objects. |
||
| 75 | * |
||
| 76 | * @param string $repositoryId the identifier for the repository |
||
| 77 | * @param BulkUpdateObjectIdAndChangeTokenInterface[] $objectIdsAndChangeTokens |
||
| 78 | * @param PropertiesInterface $properties |
||
| 79 | * @param string[] $addSecondaryTypeIds the secondary types to apply |
||
| 80 | * @param string[] $removeSecondaryTypeIds the secondary types to remove |
||
| 81 | * @param ExtensionDataInterface|null $extension |
||
| 82 | * @return BulkUpdateObjectIdAndChangeTokenInterface[] |
||
| 83 | */ |
||
| 84 | public function bulkUpdateProperties( |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @param string $action |
||
| 97 | * @param PropertiesInterface $properties |
||
| 98 | * @param string[] $policies |
||
| 99 | * @param AclInterface $addAces |
||
|
|
|||
| 100 | * @param AclInterface $removeAces |
||
| 101 | * @param ExtensionDataInterface $extension |
||
| 102 | * @return array |
||
| 103 | */ |
||
| 104 | 9 | protected function createQueryArray( |
|
| 136 | |||
| 137 | /** |
||
| 138 | * Creates a document object of the specified type (given by the cmis:objectTypeId property) |
||
| 139 | * in the (optionally) specified location. |
||
| 140 | * |
||
| 141 | * @param string $repositoryId the identifier for the repository |
||
| 142 | * @param PropertiesInterface $properties the property values that must be applied to the newly |
||
| 143 | * created document object |
||
| 144 | * @param string|null $folderId if specified, the identifier for the folder that must be the parent |
||
| 145 | * folder for the newly created document object |
||
| 146 | * @param StreamInterface|null $contentStream the content stream that must be stored for the newly |
||
| 147 | * created document object |
||
| 148 | * @param VersioningState|null $versioningState specifies what the versioning state of the newly created object |
||
| 149 | * must be (default is <code>VersioningState::MAJOR</code>) |
||
| 150 | * @param string[] $policies a list of policy IDs that must be applied to the newly created document object |
||
| 151 | * @param AclInterface|null $addAces a list of ACEs that must be added to the newly created document object, |
||
| 152 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 153 | * @param AclInterface|null $removeAces a list of ACEs that must be removed from the newly created document object, |
||
| 154 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 155 | * @param ExtensionDataInterface|null $extension |
||
| 156 | * @return string|null Returns the new object id or <code>null</code> if the repository sent an empty |
||
| 157 | * result (which should not happen) |
||
| 158 | */ |
||
| 159 | 3 | public function createDocument( |
|
| 219 | |||
| 220 | /** |
||
| 221 | * Creates a document object as a copy of the given source document in the (optionally) specified location. |
||
| 222 | * |
||
| 223 | * @param string $repositoryId the identifier for the repository |
||
| 224 | * @param string $sourceId the identifier for the source document |
||
| 225 | * @param PropertiesInterface $properties the property values that must be applied to the newly |
||
| 226 | * created document object |
||
| 227 | * @param string|null $folderId if specified, the identifier for the folder that must be the parent folder for the |
||
| 228 | * newly created document object |
||
| 229 | * @param VersioningState|null $versioningState specifies what the versioning state of the newly created object |
||
| 230 | * must be (default is <code>VersioningState::MAJOR</code>) |
||
| 231 | * @param string[] $policies a list of policy IDs that must be applied to the newly created document object |
||
| 232 | * @param AclInterface|null $addAces a list of ACEs that must be added to the newly created document object, |
||
| 233 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 234 | * @param AclInterface|null $removeAces a list of ACEs that must be removed from the newly created document object, |
||
| 235 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 236 | * @param ExtensionDataInterface|null $extension |
||
| 237 | * @return string|null Returns the new object id or <code>null</code> if the repository sent an empty |
||
| 238 | * result (which should not happen) |
||
| 239 | */ |
||
| 240 | 2 | public function createDocumentFromSource( |
|
| 275 | |||
| 276 | /** |
||
| 277 | * Creates a folder object of the specified type (given by the cmis:objectTypeId property) in |
||
| 278 | * the specified location. |
||
| 279 | * |
||
| 280 | * @param string $repositoryId the identifier for the repository |
||
| 281 | * @param PropertiesInterface $properties the property values that must be applied to the newly |
||
| 282 | * created document object |
||
| 283 | * @param string $folderId if specified, the identifier for the folder that must be the parent folder for the |
||
| 284 | * newly created document object |
||
| 285 | * @param string[] $policies a list of policy IDs that must be applied to the newly created document object |
||
| 286 | * @param AclInterface|null $addAces a list of ACEs that must be added to the newly created document object, |
||
| 287 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 288 | * @param AclInterface|null $removeAces a list of ACEs that must be removed from the newly created document object, |
||
| 289 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 290 | * @param ExtensionDataInterface|null $extension |
||
| 291 | * @return string|null Returns the new object id or <code>null</code> if the repository sent an empty |
||
| 292 | * result (which should not happen) |
||
| 293 | */ |
||
| 294 | 2 | View Code Duplication | public function createFolder( |
| 319 | |||
| 320 | /** |
||
| 321 | * Creates an item object of the specified type (given by the cmis:objectTypeId property). |
||
| 322 | * |
||
| 323 | * @param string $repositoryId The identifier for the repository |
||
| 324 | * @param PropertiesInterface $properties The property values that must be applied to the newly |
||
| 325 | * created document object |
||
| 326 | * @param string|null $folderId If specified, the identifier for the folder that must be the parent folder for the |
||
| 327 | * newly created document object |
||
| 328 | * @param string[] $policies A list of policy IDs that must be applied to the newly created document object |
||
| 329 | * @param AclInterface|null $addAces A list of ACEs that must be added to the newly created document object, |
||
| 330 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 331 | * @param AclInterface|null $removeAces A list of ACEs that must be removed from the newly created document object, |
||
| 332 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 333 | * @param ExtensionDataInterface|null $extension |
||
| 334 | * @return string|null Returns the new item id or <code>null</code> if the repository sent an empty |
||
| 335 | * result (which should not happen) |
||
| 336 | */ |
||
| 337 | 2 | public function createItem( |
|
| 367 | |||
| 368 | /** |
||
| 369 | * Creates a policy object of the specified type (given by the cmis:objectTypeId property). |
||
| 370 | * |
||
| 371 | * @param string $repositoryId The identifier for the repository |
||
| 372 | * @param PropertiesInterface $properties The property values that must be applied to the newly |
||
| 373 | * created document object |
||
| 374 | * @param string|null $folderId If specified, the identifier for the folder that must be the parent folder for the |
||
| 375 | * newly created document object |
||
| 376 | * @param string[] $policies A list of policy IDs that must be applied to the newly created document object |
||
| 377 | * @param AclInterface|null $addAces A list of ACEs that must be added to the newly created document object, |
||
| 378 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 379 | * @param AclInterface|null $removeAces A list of ACEs that must be removed from the newly created document object, |
||
| 380 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 381 | * @param ExtensionDataInterface|null $extension |
||
| 382 | * @return string The id of the newly-created policy. |
||
| 383 | */ |
||
| 384 | public function createPolicy( |
||
| 395 | |||
| 396 | /** |
||
| 397 | * Creates a relationship object of the specified type (given by the cmis:objectTypeId property). |
||
| 398 | * |
||
| 399 | * @param string $repositoryId the identifier for the repository |
||
| 400 | * @param PropertiesInterface $properties the property values that must be applied to the newly |
||
| 401 | * created document object |
||
| 402 | * @param string[] $policies a list of policy IDs that must be applied to the newly created document object |
||
| 403 | * @param AclInterface|null $addAces a list of ACEs that must be added to the newly created document object, |
||
| 404 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 405 | * @param AclInterface|null $removeAces a list of ACEs that must be removed from the newly created document object, |
||
| 406 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 407 | * @param ExtensionDataInterface|null $extension |
||
| 408 | * @return string|null Returns the new item id of the relationship object or <code>null</code> if the repository |
||
| 409 | * sent an empty result (which should not happen) |
||
| 410 | */ |
||
| 411 | View Code Duplication | public function createRelationship( |
|
| 436 | |||
| 437 | /** |
||
| 438 | * Deletes the content stream for the specified document object. |
||
| 439 | * |
||
| 440 | * @param string $repositoryId the identifier for the repository |
||
| 441 | * @param string $objectId the identifier for the object. The repository might return a different/new object id |
||
| 442 | * @param string|null $changeToken the last change token of this object that the client received. |
||
| 443 | * The repository might return a new change token (default is <code>null</code>) |
||
| 444 | * @param ExtensionDataInterface|null $extension |
||
| 445 | * @throws CmisInvalidArgumentException If $objectId is empty |
||
| 446 | */ |
||
| 447 | 3 | public function deleteContentStream( |
|
| 487 | |||
| 488 | /** |
||
| 489 | * Deletes the specified object. |
||
| 490 | * |
||
| 491 | * @param string $repositoryId the identifier for the repository |
||
| 492 | * @param string $objectId the identifier for the object |
||
| 493 | * @param boolean $allVersions If <code>true</code> then delete all versions of the document, otherwise delete only |
||
| 494 | * the document object specified (default is <code>true</code>) |
||
| 495 | * @param ExtensionDataInterface|null $extension |
||
| 496 | */ |
||
| 497 | 2 | public function deleteObject( |
|
| 514 | |||
| 515 | /** |
||
| 516 | * Deletes the specified folder object and all of its child- and descendant-objects. |
||
| 517 | * |
||
| 518 | * @param string $repositoryId the identifier for the repository |
||
| 519 | * @param string $folderId the identifier for the folder |
||
| 520 | * @param boolean $allVersions If <code>true</code> then delete all versions of the document, otherwise delete only |
||
| 521 | * the document object specified (default is <code>true</code>) |
||
| 522 | * @param UnfileObject|null $unfileObjects defines how the repository must process file-able child- or |
||
| 523 | * descendant-objects (default is <code>UnfileObject::DELETE</code>) |
||
| 524 | * @param boolean $continueOnFailure If <code>true</code>, then the repository should continue attempting to |
||
| 525 | * perform this operation even if deletion of a child- or descendant-object in the specified folder cannot |
||
| 526 | * be deleted |
||
| 527 | * @param ExtensionDataInterface|null $extension |
||
| 528 | * @return FailedToDeleteDataInterface Returns a list of object ids that could not be deleted |
||
| 529 | */ |
||
| 530 | 4 | public function deleteTree( |
|
| 556 | |||
| 557 | /** |
||
| 558 | * Gets the list of allowable actions for an object. |
||
| 559 | * |
||
| 560 | * @param string $repositoryId the identifier for the repository |
||
| 561 | * @param string $objectId the identifier for the object |
||
| 562 | * @param ExtensionDataInterface|null $extension |
||
| 563 | * @return AllowableActionsInterface |
||
| 564 | */ |
||
| 565 | public function getAllowableActions($repositoryId, $objectId, ExtensionDataInterface $extension = null) |
||
| 569 | |||
| 570 | /** |
||
| 571 | * Gets the content stream for the specified document object, or gets a rendition stream for |
||
| 572 | * a specified rendition of a document or folder object. |
||
| 573 | * |
||
| 574 | * @param string $repositoryId the identifier for the repository |
||
| 575 | * @param string $objectId the identifier for the object |
||
| 576 | * @param string|null $streamId The identifier for the rendition stream, when used to get a rendition stream. |
||
| 577 | * For documents, if not provided then this method returns the content stream. For folders, |
||
| 578 | * it MUST be provided. |
||
| 579 | * @param integer|null $offset |
||
| 580 | * @param integer|null $length |
||
| 581 | * @param ExtensionDataInterface|null $extension |
||
| 582 | * @return StreamInterface|null |
||
| 583 | * @throws CmisInvalidArgumentException If object id is empty |
||
| 584 | */ |
||
| 585 | 3 | public function getContentStream( |
|
| 617 | |||
| 618 | /** |
||
| 619 | * Gets the specified information for the object specified by id. |
||
| 620 | * |
||
| 621 | * @param string $repositoryId the identifier for the repository |
||
| 622 | * @param string $objectId the identifier for the object |
||
| 623 | * @param string|null $filter a comma-separated list of query names that defines which properties must be |
||
| 624 | * returned by the repository (default is repository specific) |
||
| 625 | * @param boolean $includeAllowableActions if <code>true</code>, then the repository must return the allowable |
||
| 626 | * actions for the object (default is <code>false</code>) |
||
| 627 | * @param IncludeRelationships|null $includeRelationships indicates what relationships in which the objects |
||
| 628 | * participate must be returned (default is <code>IncludeRelationships::NONE</code>) |
||
| 629 | * @param string $renditionFilter indicates what set of renditions the repository must return whose kind |
||
| 630 | * matches this filter (default is "cmis:none") |
||
| 631 | * @param boolean $includePolicyIds if <code>true</code>, then the repository must return the policy ids for |
||
| 632 | * the object (default is <code>false</code>) |
||
| 633 | * @param boolean $includeAcl if <code>true</code>, then the repository must return the ACL for the object |
||
| 634 | * (default is <code>false</code>) |
||
| 635 | * @param ExtensionDataInterface|null $extension |
||
| 636 | * @return ObjectDataInterface|null Returns object of type ObjectDataInterface or <code>null</code> |
||
| 637 | * if the repository response was empty |
||
| 638 | */ |
||
| 639 | 3 | View Code Duplication | public function getObject( |
| 694 | |||
| 695 | /** |
||
| 696 | * Gets the specified information for the object specified by path. |
||
| 697 | * |
||
| 698 | * @param string $repositoryId the identifier for the repository |
||
| 699 | * @param string $path the path to the object |
||
| 700 | * @param string|null $filter a comma-separated list of query names that defines which properties must be |
||
| 701 | * returned by the repository (default is repository specific) |
||
| 702 | * @param boolean $includeAllowableActions if <code>true</code>, then the repository must return the allowable |
||
| 703 | * actions for the object (default is <code>false</code>) |
||
| 704 | * @param IncludeRelationships|null $includeRelationships indicates what relationships in which the objects |
||
| 705 | * participate must be returned (default is <code>IncludeRelationships::NONE</code>) |
||
| 706 | * @param string $renditionFilter indicates what set of renditions the repository must return whose kind |
||
| 707 | * matches this filter (default is "cmis:none") |
||
| 708 | * @param boolean $includePolicyIds if <code>true</code>, then the repository must return the policy ids for |
||
| 709 | * the object (default is <code>false</code>) |
||
| 710 | * @param boolean $includeAcl if <code>true</code>, then the repository must return the ACL for the object |
||
| 711 | * (default is <code>false</code>) |
||
| 712 | * @param ExtensionDataInterface|null $extension |
||
| 713 | * @return ObjectDataInterface|null Returns object of type <code>ObjectDataInterface</code> or <code>null</code> |
||
| 714 | * if the repository response was empty |
||
| 715 | */ |
||
| 716 | 3 | View Code Duplication | public function getObjectByPath( |
| 772 | |||
| 773 | /** |
||
| 774 | * Gets the list of properties for an object. |
||
| 775 | * |
||
| 776 | * @param string $repositoryId the identifier for the repository |
||
| 777 | * @param string $objectId the identifier for the object |
||
| 778 | * @param string|null $filter a comma-separated list of query names that defines which properties must be |
||
| 779 | * returned by the repository (default is repository specific) |
||
| 780 | * @param ExtensionDataInterface|null $extension |
||
| 781 | * @return PropertiesInterface |
||
| 782 | */ |
||
| 783 | 2 | public function getProperties( |
|
| 828 | |||
| 829 | /** |
||
| 830 | * Gets the list of associated renditions for the specified object. |
||
| 831 | * Only rendition attributes are returned, not rendition stream. |
||
| 832 | * |
||
| 833 | * @param string $repositoryId the identifier for the repository |
||
| 834 | * @param string $objectId the identifier for the object |
||
| 835 | * @param string $renditionFilter indicates what set of renditions the repository must return whose kind |
||
| 836 | * matches this filter (default is "cmis:none") |
||
| 837 | * @param integer|null $maxItems the maximum number of items to return in a response |
||
| 838 | * (default is repository specific) |
||
| 839 | * @param integer $skipCount number of potential results that the repository MUST skip/page over before |
||
| 840 | * returning any results (default is 0) |
||
| 841 | * @param ExtensionDataInterface|null $extension |
||
| 842 | * @return RenditionDataInterface[] |
||
| 843 | * @throws CmisInvalidArgumentException If object id is empty or skip count not of type integer |
||
| 844 | */ |
||
| 845 | 2 | public function getRenditions( |
|
| 877 | |||
| 878 | /** |
||
| 879 | * Moves the specified file-able object from one folder to another. |
||
| 880 | * |
||
| 881 | * @param string $repositoryId the identifier for the repository |
||
| 882 | * @param string $objectId the identifier for the object. The repository might return a different/new object id |
||
| 883 | * @param string $targetFolderId the identifier for the target folder |
||
| 884 | * @param string $sourceFolderId the identifier for the source folder |
||
| 885 | * @param ExtensionDataInterface|null $extension |
||
| 886 | * @return ObjectDataInterface|null Returns object of type ObjectDataInterface or <code>null</code> |
||
| 887 | * if the repository response was empty |
||
| 888 | */ |
||
| 889 | 1 | public function moveObject( |
|
| 916 | |||
| 917 | /** |
||
| 918 | * Sets the content stream for the specified document object. |
||
| 919 | * |
||
| 920 | * @param string $repositoryId The identifier for the repository |
||
| 921 | * @param string $objectId The identifier for the object. The repository might return a different/new object id |
||
| 922 | * @param StreamInterface $contentStream The content stream |
||
| 923 | * @param boolean $overwriteFlag If <code>true</code>, then the repository must replace the existing content stream |
||
| 924 | * for the object (if any) with the input content stream. If <code>false</code>, then the repository must |
||
| 925 | * only set the input content stream for the object if the object currently does not have a content stream |
||
| 926 | * (default is <code>true</code>) |
||
| 927 | * @param string|null $changeToken The last change token of this object that the client received. |
||
| 928 | * The repository might return a new change token (default is <code>null</code>) |
||
| 929 | * @param ExtensionDataInterface|null $extension |
||
| 930 | * @throws CmisInvalidArgumentException If object id is empty |
||
| 931 | */ |
||
| 932 | 3 | public function setContentStream( |
|
| 979 | |||
| 980 | /** |
||
| 981 | * Updates properties of the specified object. |
||
| 982 | * |
||
| 983 | * @param string $repositoryId The identifier for the repository |
||
| 984 | * @param string $objectId The identifier for the object. The repository might return a different/new object id |
||
| 985 | * @param PropertiesInterface $properties The updated property values that must be applied to the object |
||
| 986 | * @param string|null $changeToken The last change token of this object that the client received. |
||
| 987 | * The repository might return a new change token (default is <code>null</code>) |
||
| 988 | * @param ExtensionDataInterface|null $extension |
||
| 989 | * @throws CmisInvalidArgumentException If $objectId is empty |
||
| 990 | */ |
||
| 991 | 3 | public function updateProperties( |
|
| 1028 | |||
| 1029 | /** |
||
| 1030 | * @param string $identifier |
||
| 1031 | * @param mixed $additionalHashValues |
||
| 1032 | * @return array |
||
| 1033 | */ |
||
| 1034 | 8 | protected function createCacheKey($identifier, $additionalHashValues) |
|
| 1041 | |||
| 1042 | /** |
||
| 1043 | * Returns TRUE if an object with cache key $identifier is currently cached. |
||
| 1044 | * |
||
| 1045 | * @param array $identifier |
||
| 1046 | * @return boolean |
||
| 1047 | */ |
||
| 1048 | 8 | protected function isCached(array $identifier) |
|
| 1052 | |||
| 1053 | /** |
||
| 1054 | * Gets the cached object with cache key $identifier. |
||
| 1055 | * |
||
| 1056 | * @param string $identifier |
||
| 1057 | * @return mixed |
||
| 1058 | */ |
||
| 1059 | protected function getCached(array $identifier) |
||
| 1066 | |||
| 1067 | /** |
||
| 1068 | * Gets the cached object with cache key $identifier. |
||
| 1069 | * |
||
| 1070 | * @param string $identifier |
||
| 1071 | * @param mixed $object |
||
| 1072 | * @return mixed |
||
| 1073 | */ |
||
| 1074 | 8 | protected function cache(array $identifier, $object) |
|
| 1079 | |||
| 1080 | /** |
||
| 1081 | * Flushes all cached entries. This is implemented as a flush-all with |
||
| 1082 | * no way to flush individual entries due to the way CMIS object data |
||
| 1083 | * gets returned from CMIS. Two widely different object data sets may |
||
| 1084 | * contain a reference to the same item and even with extensive cross |
||
| 1085 | * referencing it would be technically unfeasible to selectively clear |
||
| 1086 | * or reload an object by identifier. Such flushing would be inevitably |
||
| 1087 | * flawed with edge cases of incomplete flushing or become so complex |
||
| 1088 | * that it defeats the purpose of caching in the first place. |
||
| 1089 | * |
||
| 1090 | * Note that cache flushing only happens when modifying the repository |
||
| 1091 | * contents - which should limit the negative impact. The cache is also |
||
| 1092 | * not persistent and will only affect the current request. As such, it |
||
| 1093 | * is implemented to optimise requests where the same object, type, |
||
| 1094 | * policy etc. gets accessed multiple times. |
||
| 1095 | * |
||
| 1096 | * @return void |
||
| 1097 | */ |
||
| 1098 | 12 | protected function flushCached() |
|
| 1102 | } |
||
| 1103 |
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.