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

Skip to content

Commit 97787c6

Browse files
committed
[Workflow] Added more PHPDoc
1 parent da7893a commit 97787c6

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
@@ -35,14 +35,31 @@ public function getFunctions()
3535
);
3636
}
3737

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)
3948
{
40-
return $this->workflowRegistry->get($object, $name)->can($object, $transition);
49+
return $this->workflowRegistry->get($subject, $name)->can($subject, $transitionName);
4150
}
4251

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)
4461
{
45-
return $this->workflowRegistry->get($object, $name)->getEnabledTransitions($object);
62+
return $this->workflowRegistry->get($subject, $name)->getEnabledTransitions($subject);
4663
}
4764

4865
public function getName()

0 commit comments

Comments
 (0)