-
-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathTransitionNotFound.php
More file actions
42 lines (30 loc) · 824 Bytes
/
TransitionNotFound.php
File metadata and controls
42 lines (30 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
namespace Workflow\Exceptions;
use RuntimeException;
final class TransitionNotFound extends RuntimeException
{
private string $from;
private string $to;
private string $modelClass;
public static function make(string $from, string $to, string $modelClass): self
{
$exception = new self("Transition from `{$from}` to `{$to}` on model `{$modelClass}` was not found.");
$exception->from = $from;
$exception->to = $to;
$exception->modelClass = $modelClass;
return $exception;
}
public function getFrom(): string
{
return $this->from;
}
public function getTo(): string
{
return $this->to;
}
public function getModelClass(): string
{
return $this->modelClass;
}
}