*/
public function getState($state_id) {
if (!isset($this->configuration['states'][$state_id])) {
- throw new \InvalidArgumentException("The state '$state_id' does not exist in workflow.'");
+ throw new \InvalidArgumentException("The state '$state_id' does not exist in workflow.");
}
return new State(
$this,
*/
public function setStateLabel($state_id, $label) {
if (!$this->hasState($state_id)) {
- throw new \InvalidArgumentException("The state '$state_id' does not exist in workflow.'");
+ throw new \InvalidArgumentException("The state '$state_id' does not exist in workflow.");
}
$this->configuration['states'][$state_id]['label'] = $label;
return $this;
*/
public function deleteState($state_id) {
if (!$this->hasState($state_id)) {
- throw new \InvalidArgumentException("The state '$state_id' does not exist in workflow.'");
+ throw new \InvalidArgumentException("The state '$state_id' does not exist in workflow.");
}
if (count($this->configuration['states']) === 1) {
throw new \InvalidArgumentException("The state '$state_id' can not be deleted from workflow as it is the only state.");
*/
public function addTransition($transition_id, $label, array $from_state_ids, $to_state_id) {
if ($this->hasTransition($transition_id)) {
- throw new \InvalidArgumentException("The transition '$transition_id' already exists in workflow.'");
+ throw new \InvalidArgumentException("The transition '$transition_id' already exists in workflow.");
}
if (preg_match(static::VALID_ID_REGEX, $transition_id)) {
throw new \InvalidArgumentException("The transition ID '$transition_id' must contain only lowercase letters, numbers, and underscores.");
}
if (!$this->hasState($to_state_id)) {
- throw new \InvalidArgumentException("The state '$to_state_id' does not exist in workflow.'");
+ throw new \InvalidArgumentException("The state '$to_state_id' does not exist in workflow.");
}
$this->configuration['transitions'][$transition_id] = [
'label' => $label,
*/
public function getTransition($transition_id) {
if (!$this->hasTransition($transition_id)) {
- throw new \InvalidArgumentException("The transition '$transition_id' does not exist in workflow.'");
+ throw new \InvalidArgumentException("The transition '$transition_id' does not exist in workflow.");
}
return new Transition(
$this,
public function getTransitionFromStateToState($from_state_id, $to_state_id) {
$transition_id = $this->getTransitionIdFromStateToState($from_state_id, $to_state_id);
if (empty($transition_id)) {
- throw new \InvalidArgumentException("The transition from '$from_state_id' to '$to_state_id' does not exist in workflow.'");
+ throw new \InvalidArgumentException("The transition from '$from_state_id' to '$to_state_id' does not exist in workflow.");
}
return $this->getTransition($transition_id);
}