File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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+
212216Using Events
213217------------
214218
You can’t perform that action at this time.
0 commit comments