Skip to content

Commit 4d8e66a

Browse files
committed
minor #9504 Use the new TransitionException in Workflow examples (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Use the new TransitionException in Workflow examples This fixes #9478. I couldn't find any other usage of the old `LogicException` class. Commits ------- d1f4384 Use the new TransitionException in Workflow examples
2 parents cfed0b8 + d1f4384 commit 4d8e66a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

workflow/usage.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ you can get the workflow by injecting the Workflow registry service::
181181
use Symfony\Component\Workflow\Registry;
182182
use App\Entity\BlogPost;
183183
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
184-
use Symfony\Component\Workflow\Exception\LogicException;
184+
use Symfony\Component\Workflow\Exception\TransitionException;
185185

186186
class BlogController extends Controller
187187
{
@@ -200,7 +200,7 @@ you can get the workflow by injecting the Workflow registry service::
200200
// Update the currentState on the post
201201
try {
202202
$workflow->apply($post, 'to_review');
203-
} catch (LogicException $exception) {
203+
} catch (TransitionException $exception) {
204204
// ... if the transition is not allowed
205205
}
206206

@@ -209,6 +209,10 @@ you can get the workflow by injecting the Workflow registry service::
209209
}
210210
}
211211

212+
.. versionadded:: 4.1
213+
The :class:`Symfony\\Component\\Workflow\\Exception\\TransitionException`
214+
class was introduced in Symfony 4.1.
215+
212216
Using Events
213217
------------
214218

0 commit comments

Comments
 (0)