1 | <?php |
||
25 | class IncompatibleProcessException extends UnexpectedValueException |
||
26 | { |
||
27 | |||
28 | /** |
||
29 | * Constants |
||
30 | */ |
||
31 | |||
32 | /** |
||
33 | * The default exception message. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | const DEFAULT_MESSAGE = 'Provided or resolved process is not compatible'; |
||
38 | |||
39 | /** |
||
40 | * The exception code for when context compatibility is required. |
||
41 | * |
||
42 | * @var int |
||
43 | */ |
||
44 | const CODE_FOR_REQUIRED_CONTEXT_COMPATIBILITY = 1; |
||
45 | |||
46 | /** |
||
47 | * The exception code for when a hydrator is used as the process. |
||
48 | * |
||
49 | * @var int |
||
50 | */ |
||
51 | const CODE_FOR_HYDRATOR = 2; |
||
52 | |||
53 | /** |
||
54 | * The exception code for when a builder is used as the process. |
||
55 | * |
||
56 | * @var int |
||
57 | */ |
||
58 | const CODE_FOR_BUILDER = 4; |
||
59 | |||
60 | /** |
||
61 | * The message extension (appended to the default message) for when context |
||
62 | * compatibility is required. |
||
63 | * |
||
64 | * @var string |
||
65 | */ |
||
66 | const MESSAGE_EXTENSION_FOR_REQUIRED_CONTEXT_COMPATIBILITY = ' due to requiring context compatibility'; |
||
67 | |||
68 | |||
69 | /** |
||
70 | * Properties |
||
71 | */ |
||
72 | |||
73 | /** |
||
74 | * The exception message. |
||
75 | * |
||
76 | * @var string |
||
77 | */ |
||
78 | protected $message = self::DEFAULT_MESSAGE; |
||
79 | |||
80 | |||
81 | /** |
||
82 | * Methods |
||
83 | */ |
||
84 | |||
85 | /** |
||
86 | * Create an exception instance for when context compatibility is required. |
||
87 | * |
||
88 | * @param object|null $process The incompatible process. |
||
89 | * @param int $code The exception code. |
||
90 | * @param Throwable|null $previous A previous exception used for chaining. |
||
91 | * @return static The newly created exception. |
||
92 | */ |
||
93 | 18 | public static function forRequiredContextCompatibility( |
|
110 | } |
||
111 |