Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EWPP-3080: Make getNextTransitions public and NULL out unused argument. #119

Merged
merged 2 commits into from
May 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@ public function getValidTransitions(ContentEntityInterface $entity, AccountInter
*
* @param \Drupal\workflows\StateInterface $current_state
* The actual state.
* @param \Drupal\Core\Entity\ContentEntityInterface $entity
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets mark it as deprecated to be deleted next major release

* The entity under moderation.
* @param \Drupal\Core\Entity\ContentEntityInterface|null $entity
* (deprecated) The entity under moderation. The parameter is
* deprecated in 2.0.0 and will be removed from 3.0.0.
* @param array $next_transitions
* The next available transitions in the chain that we keep track of by
* recursion.
*
* @return array
* The next available transitions in the chain.
*/
protected function getNextTransitions(StateInterface $current_state, ContentEntityInterface $entity, array &$next_transitions = []): array {
public function getNextTransitions(StateInterface $current_state, ?ContentEntityInterface $entity = NULL, array &$next_transitions = []): array {
$transitions = $current_state->getTransitions();
if (empty($next_transitions)) {
$next_transitions = $transitions;
Expand Down