TermStorageInterface::loadTree declares that it returns \Drupal\taxonomy\TermInterface[].
But it returns just stdClass objects array when $load_entities parameter is FALSE.

CommentFileSizeAuthor
#3 wrong-return-type-2659564-3.patch738 bytesmiteshmap

Comments

undertext created an issue. See original summary.

jhodgdon’s picture

Issue tags: +Novice

Thanks for the issue!

So we can use the | syntax to say it's either object[] or Drupal\taxonomy\TermInterface[]. See
https://www.drupal.org/node/1354#types
for details. Should be a good Novice project.

miteshmap’s picture

StatusFileSize
new738 bytes
miteshmap’s picture

Status: Active » Needs review
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Yes, that looks right, thanks!

  • catch committed c7b117b on 8.1.x
    Issue #2659564 by miteshmap: Wrong return type in TermStorageInterface::...

  • catch committed 67027da on 8.0.x
    Issue #2659564 by miteshmap: Wrong return type in TermStorageInterface::...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Theoretically changing the return value of the interface would be an API change. However in practice this return type depends on a parameter, so it's impossible to implement the interface as it's documented at the moment - the param and return docs are mutually exclusive. Additionally it's extremely unlikely anyone is implementing this in contrib or custom code.

Committed/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.