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( |
|
| 210 | |||
| 211 | /** |
||
| 212 | * Creates a document object as a copy of the given source document in the (optionally) specified location. |
||
| 213 | * |
||
| 214 | * @param string $repositoryId the identifier for the repository |
||
| 215 | * @param string $sourceId the identifier for the source document |
||
| 216 | * @param PropertiesInterface $properties the property values that must be applied to the newly |
||
| 217 | * created document object |
||
| 218 | * @param string|null $folderId if specified, the identifier for the folder that must be the parent folder for the |
||
| 219 | * newly created document object |
||
| 220 | * @param VersioningState|null $versioningState specifies what the versioning state of the newly created object |
||
| 221 | * must be (default is <code>VersioningState::MAJOR</code>) |
||
| 222 | * @param string[] $policies a list of policy IDs that must be applied to the newly created document object |
||
| 223 | * @param AclInterface|null $addAces a list of ACEs that must be added to the newly created document object, |
||
| 224 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 225 | * @param AclInterface|null $removeAces a list of ACEs that must be removed from the newly created document object, |
||
| 226 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 227 | * @param ExtensionDataInterface|null $extension |
||
| 228 | * @return string|null Returns the new object id or <code>null</code> if the repository sent an empty |
||
| 229 | * result (which should not happen) |
||
| 230 | */ |
||
| 231 | 2 | public function createDocumentFromSource( |
|
| 266 | |||
| 267 | /** |
||
| 268 | * Creates a folder object of the specified type (given by the cmis:objectTypeId property) in |
||
| 269 | * the specified location. |
||
| 270 | * |
||
| 271 | * @param string $repositoryId the identifier for the repository |
||
| 272 | * @param PropertiesInterface $properties the property values that must be applied to the newly |
||
| 273 | * created document object |
||
| 274 | * @param string $folderId if specified, the identifier for the folder that must be the parent folder for the |
||
| 275 | * newly created document object |
||
| 276 | * @param string[] $policies a list of policy IDs that must be applied to the newly created document object |
||
| 277 | * @param AclInterface|null $addAces a list of ACEs that must be added to the newly created document object, |
||
| 278 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 279 | * @param AclInterface|null $removeAces a list of ACEs that must be removed from the newly created document object, |
||
| 280 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 281 | * @param ExtensionDataInterface|null $extension |
||
| 282 | * @return string|null Returns the new object id or <code>null</code> if the repository sent an empty |
||
| 283 | * result (which should not happen) |
||
| 284 | */ |
||
| 285 | 2 | View Code Duplication | public function createFolder( |
| 310 | |||
| 311 | /** |
||
| 312 | * Creates an item object of the specified type (given by the cmis:objectTypeId property). |
||
| 313 | * |
||
| 314 | * @param string $repositoryId The identifier for the repository |
||
| 315 | * @param PropertiesInterface $properties The property values that must be applied to the newly |
||
| 316 | * created document object |
||
| 317 | * @param string|null $folderId If specified, the identifier for the folder that must be the parent folder for the |
||
| 318 | * newly created document object |
||
| 319 | * @param string[] $policies A list of policy IDs that must be applied to the newly created document object |
||
| 320 | * @param AclInterface|null $addAces A list of ACEs that must be added to the newly created document object, |
||
| 321 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 322 | * @param AclInterface|null $removeAces A list of ACEs that must be removed from the newly created document object, |
||
| 323 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 324 | * @param ExtensionDataInterface|null $extension |
||
| 325 | * @return string|null Returns the new item id or <code>null</code> if the repository sent an empty |
||
| 326 | * result (which should not happen) |
||
| 327 | */ |
||
| 328 | 2 | public function createItem( |
|
| 358 | |||
| 359 | /** |
||
| 360 | * Creates a policy object of the specified type (given by the cmis:objectTypeId property). |
||
| 361 | * |
||
| 362 | * @param string $repositoryId The identifier for the repository |
||
| 363 | * @param PropertiesInterface $properties The property values that must be applied to the newly |
||
| 364 | * created document object |
||
| 365 | * @param string|null $folderId If specified, the identifier for the folder that must be the parent folder for the |
||
| 366 | * newly created document object |
||
| 367 | * @param string[] $policies A list of policy IDs that must be applied to the newly created document object |
||
| 368 | * @param AclInterface|null $addAces A list of ACEs that must be added to the newly created document object, |
||
| 369 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 370 | * @param AclInterface|null $removeAces A list of ACEs that must be removed from the newly created document object, |
||
| 371 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 372 | * @param ExtensionDataInterface|null $extension |
||
| 373 | * @return string The id of the newly-created policy. |
||
| 374 | */ |
||
| 375 | public function createPolicy( |
||
| 386 | |||
| 387 | /** |
||
| 388 | * Creates a relationship object of the specified type (given by the cmis:objectTypeId property). |
||
| 389 | * |
||
| 390 | * @param string $repositoryId the identifier for the repository |
||
| 391 | * @param PropertiesInterface $properties the property values that must be applied to the newly |
||
| 392 | * created document object |
||
| 393 | * @param string[] $policies a list of policy IDs that must be applied to the newly created document object |
||
| 394 | * @param AclInterface|null $addAces a list of ACEs that must be added to the newly created document object, |
||
| 395 | * either using the ACL from folderId if specified, or being applied if no folderId is specified |
||
| 396 | * @param AclInterface|null $removeAces a list of ACEs that must be removed from the newly created document object, |
||
| 397 | * either using the ACL from folderId if specified, or being ignored if no folderId is specified |
||
| 398 | * @param ExtensionDataInterface|null $extension |
||
| 399 | * @return string|null Returns the new item id of the relationship object or <code>null</code> if the repository |
||
| 400 | * sent an empty result (which should not happen) |
||
| 401 | */ |
||
| 402 | View Code Duplication | public function createRelationship( |
|
| 427 | |||
| 428 | /** |
||
| 429 | * Deletes the content stream for the specified document object. |
||
| 430 | * |
||
| 431 | * @param string $repositoryId the identifier for the repository |
||
| 432 | * @param string $objectId the identifier for the object. The repository might return a different/new object id |
||
| 433 | * @param string|null $changeToken the last change token of this object that the client received. |
||
| 434 | * The repository might return a new change token (default is <code>null</code>) |
||
| 435 | * @param ExtensionDataInterface|null $extension |
||
| 436 | * @throws CmisInvalidArgumentException If $objectId is empty |
||
| 437 | */ |
||
| 438 | 3 | public function deleteContentStream( |
|
| 478 | |||
| 479 | /** |
||
| 480 | * Deletes the specified object. |
||
| 481 | * |
||
| 482 | * @param string $repositoryId the identifier for the repository |
||
| 483 | * @param string $objectId the identifier for the object |
||
| 484 | * @param boolean $allVersions If <code>true</code> then delete all versions of the document, otherwise delete only |
||
| 485 | * the document object specified (default is <code>true</code>) |
||
| 486 | * @param ExtensionDataInterface|null $extension |
||
| 487 | */ |
||
| 488 | 2 | View Code Duplication | public function deleteObject( |
| 505 | |||
| 506 | /** |
||
| 507 | * Deletes the specified folder object and all of its child- and descendant-objects. |
||
| 508 | * |
||
| 509 | * @param string $repositoryId the identifier for the repository |
||
| 510 | * @param string $folderId the identifier for the folder |
||
| 511 | * @param boolean $allVersions If <code>true</code> then delete all versions of the document, otherwise delete only |
||
| 512 | * the document object specified (default is <code>true</code>) |
||
| 513 | * @param UnfileObject|null $unfileObjects defines how the repository must process file-able child- or |
||
| 514 | * descendant-objects (default is <code>UnfileObject::DELETE</code>) |
||
| 515 | * @param boolean $continueOnFailure If <code>true</code>, then the repository should continue attempting to |
||
| 516 | * perform this operation even if deletion of a child- or descendant-object in the specified folder cannot |
||
| 517 | * be deleted |
||
| 518 | * @param ExtensionDataInterface|null $extension |
||
| 519 | * @return FailedToDeleteDataInterface Returns a list of object ids that could not be deleted |
||
| 520 | */ |
||
| 521 | 4 | public function deleteTree( |
|
| 552 | |||
| 553 | /** |
||
| 554 | * Gets the list of allowable actions for an object. |
||
| 555 | * |
||
| 556 | * @param string $repositoryId the identifier for the repository |
||
| 557 | * @param string $objectId the identifier for the object |
||
| 558 | * @param ExtensionDataInterface|null $extension |
||
| 559 | * @return AllowableActionsInterface |
||
| 560 | */ |
||
| 561 | public function getAllowableActions($repositoryId, $objectId, ExtensionDataInterface $extension = null) |
||
| 565 | |||
| 566 | /** |
||
| 567 | * Gets the content stream for the specified document object, or gets a rendition stream for |
||
| 568 | * a specified rendition of a document or folder object. |
||
| 569 | * |
||
| 570 | * @param string $repositoryId the identifier for the repository |
||
| 571 | * @param string $objectId the identifier for the object |
||
| 572 | * @param string|null $streamId The identifier for the rendition stream, when used to get a rendition stream. |
||
| 573 | * For documents, if not provided then this method returns the content stream. For folders, |
||
| 574 | * it MUST be provided. |
||
| 575 | * @param integer|null $offset |
||
| 576 | * @param integer|null $length |
||
| 577 | * @param ExtensionDataInterface|null $extension |
||
| 578 | * @return StreamInterface|null |
||
| 579 | * @throws CmisInvalidArgumentException If object id is empty |
||
| 580 | */ |
||
| 581 | 3 | public function getContentStream( |
|
| 613 | |||
| 614 | /** |
||
| 615 | * Gets the specified information for the object specified by id. |
||
| 616 | * |
||
| 617 | * @param string $repositoryId the identifier for the repository |
||
| 618 | * @param string $objectId the identifier for the object |
||
| 619 | * @param string|null $filter a comma-separated list of query names that defines which properties must be |
||
| 620 | * returned by the repository (default is repository specific) |
||
| 621 | * @param boolean $includeAllowableActions if <code>true</code>, then the repository must return the allowable |
||
| 622 | * actions for the object (default is <code>false</code>) |
||
| 623 | * @param IncludeRelationships|null $includeRelationships indicates what relationships in which the objects |
||
| 624 | * participate must be returned (default is <code>IncludeRelationships::NONE</code>) |
||
| 625 | * @param string $renditionFilter indicates what set of renditions the repository must return whose kind |
||
| 626 | * matches this filter (default is "cmis:none") |
||
| 627 | * @param boolean $includePolicyIds if <code>true</code>, then the repository must return the policy ids for |
||
| 628 | * the object (default is <code>false</code>) |
||
| 629 | * @param boolean $includeAcl if <code>true</code>, then the repository must return the ACL for the object |
||
| 630 | * (default is <code>false</code>) |
||
| 631 | * @param ExtensionDataInterface|null $extension |
||
| 632 | * @return ObjectDataInterface|null Returns object of type ObjectDataInterface or <code>null</code> |
||
| 633 | * if the repository response was empty |
||
| 634 | */ |
||
| 635 | 3 | View Code Duplication | public function getObject( |
| 690 | |||
| 691 | /** |
||
| 692 | * Gets the specified information for the object specified by path. |
||
| 693 | * |
||
| 694 | * @param string $repositoryId the identifier for the repository |
||
| 695 | * @param string $path the path to the object |
||
| 696 | * @param string|null $filter a comma-separated list of query names that defines which properties must be |
||
| 697 | * returned by the repository (default is repository specific) |
||
| 698 | * @param boolean $includeAllowableActions if <code>true</code>, then the repository must return the allowable |
||
| 699 | * actions for the object (default is <code>false</code>) |
||
| 700 | * @param IncludeRelationships|null $includeRelationships indicates what relationships in which the objects |
||
| 701 | * participate must be returned (default is <code>IncludeRelationships::NONE</code>) |
||
| 702 | * @param string $renditionFilter indicates what set of renditions the repository must return whose kind |
||
| 703 | * matches this filter (default is "cmis:none") |
||
| 704 | * @param boolean $includePolicyIds if <code>true</code>, then the repository must return the policy ids for |
||
| 705 | * the object (default is <code>false</code>) |
||
| 706 | * @param boolean $includeAcl if <code>true</code>, then the repository must return the ACL for the object |
||
| 707 | * (default is <code>false</code>) |
||
| 708 | * @param ExtensionDataInterface|null $extension |
||
| 709 | * @return ObjectDataInterface|null Returns object of type <code>ObjectDataInterface</code> or <code>null</code> |
||
| 710 | * if the repository response was empty |
||
| 711 | */ |
||
| 712 | 3 | View Code Duplication | public function getObjectByPath( |
| 768 | |||
| 769 | /** |
||
| 770 | * Gets the list of properties for an object. |
||
| 771 | * |
||
| 772 | * @param string $repositoryId the identifier for the repository |
||
| 773 | * @param string $objectId the identifier for the object |
||
| 774 | * @param string|null $filter a comma-separated list of query names that defines which properties must be |
||
| 775 | * returned by the repository (default is repository specific) |
||
| 776 | * @param ExtensionDataInterface|null $extension |
||
| 777 | * @return PropertiesInterface |
||
| 778 | */ |
||
| 779 | 2 | public function getProperties( |
|
| 824 | |||
| 825 | /** |
||
| 826 | * Gets the list of associated renditions for the specified object. |
||
| 827 | * Only rendition attributes are returned, not rendition stream. |
||
| 828 | * |
||
| 829 | * @param string $repositoryId the identifier for the repository |
||
| 830 | * @param string $objectId the identifier for the object |
||
| 831 | * @param string $renditionFilter indicates what set of renditions the repository must return whose kind |
||
| 832 | * matches this filter (default is "cmis:none") |
||
| 833 | * @param integer|null $maxItems the maximum number of items to return in a response |
||
| 834 | * (default is repository specific) |
||
| 835 | * @param integer $skipCount number of potential results that the repository MUST skip/page over before |
||
| 836 | * returning any results (default is 0) |
||
| 837 | * @param ExtensionDataInterface|null $extension |
||
| 838 | * @return RenditionDataInterface[] |
||
| 839 | * @throws CmisInvalidArgumentException If object id is empty or skip count not of type integer |
||
| 840 | */ |
||
| 841 | 2 | public function getRenditions( |
|
| 873 | |||
| 874 | /** |
||
| 875 | * Moves the specified file-able object from one folder to another. |
||
| 876 | * |
||
| 877 | * @param string $repositoryId the identifier for the repository |
||
| 878 | * @param string $objectId the identifier for the object. The repository might return a different/new object id |
||
| 879 | * @param string $targetFolderId the identifier for the target folder |
||
| 880 | * @param string $sourceFolderId the identifier for the source folder |
||
| 881 | * @param ExtensionDataInterface|null $extension |
||
| 882 | * @return ObjectDataInterface|null Returns object of type ObjectDataInterface or <code>null</code> |
||
| 883 | * if the repository response was empty |
||
| 884 | */ |
||
| 885 | 1 | public function moveObject( |
|
| 912 | |||
| 913 | /** |
||
| 914 | * Sets the content stream for the specified document object. |
||
| 915 | * |
||
| 916 | * @param string $repositoryId The identifier for the repository |
||
| 917 | * @param string $objectId The identifier for the object. The repository might return a different/new object id |
||
| 918 | * @param StreamInterface $contentStream The content stream |
||
| 919 | * @param boolean $overwriteFlag If <code>true</code>, then the repository must replace the existing content stream |
||
| 920 | * for the object (if any) with the input content stream. If <code>false</code>, then the repository must |
||
| 921 | * only set the input content stream for the object if the object currently does not have a content stream |
||
| 922 | * (default is <code>true</code>) |
||
| 923 | * @param string|null $changeToken The last change token of this object that the client received. |
||
| 924 | * The repository might return a new change token (default is <code>null</code>) |
||
| 925 | * @param ExtensionDataInterface|null $extension |
||
| 926 | * @throws CmisInvalidArgumentException If object id is empty |
||
| 927 | */ |
||
| 928 | 3 | public function setContentStream( |
|
| 975 | |||
| 976 | /** |
||
| 977 | * Updates properties of the specified object. |
||
| 978 | * |
||
| 979 | * @param string $repositoryId The identifier for the repository |
||
| 980 | * @param string $objectId The identifier for the object. The repository might return a different/new object id |
||
| 981 | * @param PropertiesInterface $properties The updated property values that must be applied to the object |
||
| 982 | * @param string|null $changeToken The last change token of this object that the client received. |
||
| 983 | * The repository might return a new change token (default is <code>null</code>) |
||
| 984 | * @param ExtensionDataInterface|null $extension |
||
| 985 | * @throws CmisInvalidArgumentException If $objectId is empty |
||
| 986 | */ |
||
| 987 | 3 | public function updateProperties( |
|
| 1024 | |||
| 1025 | /** |
||
| 1026 | * @param string $identifier |
||
| 1027 | * @param mixed $additionalHashValues |
||
| 1028 | * @return array |
||
| 1029 | */ |
||
| 1030 | 8 | protected function createCacheKey($identifier, $additionalHashValues) |
|
| 1037 | |||
| 1038 | /** |
||
| 1039 | * Returns TRUE if an object with cache key $identifier is currently cached. |
||
| 1040 | * |
||
| 1041 | * @param array $identifier |
||
| 1042 | * @return boolean |
||
| 1043 | */ |
||
| 1044 | 8 | protected function isCached(array $identifier) |
|
| 1048 | |||
| 1049 | /** |
||
| 1050 | * Gets the cached object with cache key $identifier. |
||
| 1051 | * |
||
| 1052 | * @param string $identifier |
||
| 1053 | * @return mixed |
||
| 1054 | */ |
||
| 1055 | protected function getCached(array $identifier) |
||
| 1062 | |||
| 1063 | /** |
||
| 1064 | * Gets the cached object with cache key $identifier. |
||
| 1065 | * |
||
| 1066 | * @param string $identifier |
||
| 1067 | * @param mixed $object |
||
| 1068 | * @return mixed |
||
| 1069 | */ |
||
| 1070 | 8 | protected function cache(array $identifier, $object) |
|
| 1075 | |||
| 1076 | /** |
||
| 1077 | * Flushes all cached entries. This is implemented as a flush-all with |
||
| 1078 | * no way to flush individual entries due to the way CMIS object data |
||
| 1079 | * gets returned from CMIS. Two widely different object data sets may |
||
| 1080 | * contain a reference to the same item and even with extensive cross |
||
| 1081 | * referencing it would be technically unfeasible to selectively clear |
||
| 1082 | * or reload an object by identifier. Such flushing would be inevitably |
||
| 1083 | * flawed with edge cases of incomplete flushing or become so complex |
||
| 1084 | * that it defeats the purpose of caching in the first place. |
||
| 1085 | * |
||
| 1086 | * Note that cache flushing only happens when modifying the repository |
||
| 1087 | * contents - which should limit the negative impact. The cache is also |
||
| 1088 | * not persistent and will only affect the current request. As such, it |
||
| 1089 | * is implemented to optimise requests where the same object, type, |
||
| 1090 | * policy etc. gets accessed multiple times. |
||
| 1091 | * |
||
| 1092 | * @return void |
||
| 1093 | */ |
||
| 1094 | 12 | protected function flushCached() |
|
| 1098 | } |
||
| 1099 |
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.