Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cbb0c18

Browse files
committed
minor #22195 [Workflow] Added more PHPDoc (lyrixx)
This PR was merged into the 3.3-dev branch. Discussion ---------- [Workflow] Added more PHPDoc | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - --- asked by @fabpot / @HeahDude Commits ------- 97787c6 [Workflow] Added more PHPDoc
2 parents d0e904b + 97787c6 commit cbb0c18

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,31 @@ public function getFunctions()
3636
);
3737
}
3838

39-
public function canTransition($object, $transition, $name = null)
39+
/**
40+
* Returns true if the transition is enabled.
41+
*
42+
* @param object $subject A subject
43+
* @param string $transitionName A transition
44+
* @param string $name A workflow name
45+
*
46+
* @return bool true if the transition is enabled
47+
*/
48+
public function canTransition($subject, $transitionName, $name = null)
4049
{
41-
return $this->workflowRegistry->get($object, $name)->can($object, $transition);
50+
return $this->workflowRegistry->get($subject, $name)->can($subject, $transitionName);
4251
}
4352

44-
public function getEnabledTransitions($object, $name = null)
53+
/**
54+
* Returns all enabled transitions.
55+
*
56+
* @param object $subject A subject
57+
* @param string $name A workflow name
58+
*
59+
* @return Transition[] All enabled transitions
60+
*/
61+
public function getEnabledTransitions($subject, $name = null)
4562
{
46-
return $this->workflowRegistry->get($object, $name)->getEnabledTransitions($object);
63+
return $this->workflowRegistry->get($subject, $name)->getEnabledTransitions($subject);
4764
}
4865

4966
public function hasMarkedPlace($object, $place, $name = null)

0 commit comments

Comments
 (0)