Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aad89c0

Browse filesBrowse files
committed
[Workflow] Added more PHPDoc
1 parent da7893a commit aad89c0
Copy full SHA for aad89c0

File tree

1 file changed

+21
-4
lines changed
Filter options

1 file changed

+21
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php
+21-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.