Skip to content

Commit 645f868

Browse files
committed
minor symfony#57519 [Workflow] Add phpdoc about exception (VincentLanglet)
This PR was merged into the 7.2 branch. Discussion ---------- [Workflow] Add phpdoc about exception | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Fix #... | License | MIT I recently changed a `can` call to a `buildTransitionBlockerList` and got many exceptions. When looking at the interface we could believe the behavior of these method are similar with - can returning true/false - buildTransitionBlockerList returning a list empty or not But it's not true. When we try to call `buildTransitionBlockerList` with a not defined transition, - can return false - buildTransitionBlockerList throw an exception I think this should at least be mentioned in the PHPdoc. Dunno if this need to wait 7.2 or can be done on previous versions. cc `@lyrixx` Commits ------- 66f3340 Add phpdoc about exception
2 parents 17f449d + 66f3340 commit 645f868

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/Workflow/WorkflowInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Workflow;
1313

1414
use Symfony\Component\Workflow\Exception\LogicException;
15+
use Symfony\Component\Workflow\Exception\UndefinedTransitionException;
1516
use Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface;
1617
use Symfony\Component\Workflow\Metadata\MetadataStoreInterface;
1718

@@ -38,6 +39,8 @@ public function can(object $subject, string $transitionName): bool;
3839

3940
/**
4041
* Builds a TransitionBlockerList to know why a transition is blocked.
42+
*
43+
* @throws UndefinedTransitionException If the transition is not defined
4144
*/
4245
public function buildTransitionBlockerList(object $subject, string $transitionName): TransitionBlockerList;
4346

0 commit comments

Comments
 (0)