@@ -35,14 +35,31 @@ public function getFunctions()
35
35
);
36
36
}
37
37
38
- public function canTransition ($ object , $ transition , $ name = null )
38
+ /**
39
+ * Returns true if the transition is enabled.
40
+ *
41
+ * @param object $subject A subject
42
+ * @param string $transitionName A transition
43
+ * @param string $name A workflow name
44
+ *
45
+ * @return bool true if the transition is enabled
46
+ */
47
+ public function canTransition ($ subject , $ transitionName , $ name = null )
39
48
{
40
- return $ this ->workflowRegistry ->get ($ object , $ name )->can ($ object , $ transition );
49
+ return $ this ->workflowRegistry ->get ($ subject , $ name )->can ($ subject , $ transitionName );
41
50
}
42
51
43
- public function getEnabledTransitions ($ object , $ name = null )
52
+ /**
53
+ * Returns all enabled transitions.
54
+ *
55
+ * @param object $subject A subject
56
+ * @param string $name A workflow name
57
+ *
58
+ * @return Transition[] All enabled transitions
59
+ */
60
+ public function getEnabledTransitions ($ subject , $ name = null )
44
61
{
45
- return $ this ->workflowRegistry ->get ($ object , $ name )->getEnabledTransitions ($ object );
62
+ return $ this ->workflowRegistry ->get ($ subject , $ name )->getEnabledTransitions ($ subject );
46
63
}
47
64
48
65
public function getName ()
0 commit comments