Problem/Motivation

The docs for WorkflowTypeInterface::getTransitionsForState() say:

   * @return array
   *   The transition IDs for a state for the provided direction.

But what is actually returned is an array of objects, same as getTransitions().

The docs should also say the array is keyed by transition ID (unlike the docs for getTransitions()).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3346099

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

rckstr_rohan made their first commit to this issue’s fork.

rohan-sinha’s picture

Status: Active » Needs review

make a little change to the doc comment

joachim’s picture

Status: Needs review » Needs work

> * The array is keyed by transition IDs for a state for the provided direction.

This says what the keys are, but doesn't say what the values are.

Also, the sentence doesn't read right. @return docs typically start with a noun phrase. This should say something like:

> An array of the transition objects for the state in the given direction, keyed by transition ID.

rohan-sinha’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Do think that reads better.

smustgrave’s picture

dww’s picture

Status: Reviewed & tested by the community » Needs work

Added some MR review points that should be fixed before this is committed.

Thanks!
-Derek

dww’s picture

Status: Needs work » Needs review

Pushed a commit to fix my concerns. Also rebased to 10.1.x and wrapped the @return docs to 80 chars. Needs re-review.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Even better! Thanks for taking a look @dww

dww’s picture

Issue tags: +Bug Smash Initiative

Thanks for re-review! Also, tagging for bugsmash. 😉

  • larowlan committed dbf2a139 on 10.0.x
    Issue #3346099 by rckstr_rohan, dww, joachim, smustgrave: @return docs...

  • larowlan committed 542a79d6 on 10.1.x
    Issue #3346099 by rckstr_rohan, dww, joachim, smustgrave: @return docs...

  • larowlan committed d135e523 on 9.5.x
    Issue #3346099 by rckstr_rohan, dww, joachim, smustgrave: @return docs...
larowlan’s picture

Version: 10.1.x-dev » 9.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed to 10.1.x and backported to 10.0.x and 9.5.x

Thanks

Status: Fixed » Closed (fixed)

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