Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9fa4f79

Browse files
andrewtchlyrixx
authored andcommitted
implemented TransitionException to be thrown instead of Logic exception
1 parent 4bbdf06 commit 9fa4f79

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Workflow\Exception;
13+
14+
/**
15+
* @author Andrew Tch <[email protected]>
16+
*/
17+
class TransitionException extends LogicException
18+
{
19+
/**
20+
* @var mixed
21+
*/
22+
private $subject;
23+
24+
/**
25+
* @var string
26+
*/
27+
private $transitionName;
28+
29+
/**
30+
* @var string
31+
*/
32+
private $workflowName;
33+
34+
public function __construct($subject, $transitionName, $workflowName)
35+
{
36+
$this->subject = $subject;
37+
$this->transitionName = $transitionName;
38+
$this->workflowName = $workflowName;
39+
40+
parent::__construct(sprintf('Unable to apply transition "%s" for workflow "%s".', $this->transitionName, $this->workflowName));
41+
}
42+
43+
/**
44+
* @return mixed
45+
*/
46+
public function getSubject()
47+
{
48+
return $this->subject;
49+
}
50+
51+
/**
52+
* @return string
53+
*/
54+
public function getTransitionName()
55+
{
56+
return $this->transitionName;
57+
}
58+
59+
/**
60+
* @return string
61+
*/
62+
public function getWorkflowName()
63+
{
64+
return $this->workflowName;
65+
}
66+
}

0 commit comments

Comments
 (0)