8000 bug #43393 GuardEvent::getTransition() cannot return null (toby-griff… · symfony/symfony@d468bfd · GitHub
[go: up one dir, main page]

Skip to content

Commit d468bfd

Browse files
committed
bug #43393 GuardEvent::getTransition() cannot return null (toby-griffiths)
This PR was merged into the 5.4 branch. Discussion ---------- GuardEvent::getTransition() cannot return null | 8000 Q | A | ------------- | --- | Branch? | 5.4? | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a Since $transition is required on the constructor, we can type thint that getTransition always return the `Transition`, rather than `Transition|null`. This is a purely annotation change so no change to CHANGELOG or tests, but please let me know if this is desired, or I should target a different branch. I'm also happy to update the other events that are only ever called with with a concrete Transition, if this is acceptable, however I need guidance on whether there's a change these could be called without the Transition in other uses, somehow, or not. Commits ------- 75bc96d GuardEvent::getTransition() cannot return null
2 parents 21528c6 + 75bc96d commit d468bfd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Workflow/Event/GuardEvent.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ public function __construct(object $subject, Marking $marking, Transition $trans
3535
$this->transitionBlockerList = new TransitionBlockerList();
3636
}
3737

38+
public function getTransition(): Transition
39+
{
40+
return parent::getTransition();
41+
}
42+
3843
public function isBlocked(): bool
3944
{
4045
return !$this->transitionBlockerList->isEmpty();

0 commit comments

Comments
 (0)
0