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
43
44
45
46
|
<?php
namespace AutomateWoo\Exceptions;
use RuntimeException;
/** * Class InvalidWorkflow * * @since 5.1.0 */ class InvalidWorkflow extends RuntimeException implements Exception {
/** * Create a new exception when a given workflow ID already exists. * * @param string|int $id * * @return static */ public static function workflow_exists( $id ): InvalidWorkflow { return new static( sprintf( 'The workflow with ID "%s" already exists.', $id ) ); }
/** * Create a new exception when there is an issue creating a new workflow. * * @param string $error * * @return InvalidWorkflow */ public static function error_creating_workflow( $error ): InvalidWorkflow { return new static( sprintf( 'There was an error creating the workflow: "%s"', $error ) ); }
/** * Create a new exception when there is an issue updating an existing workflow. * * @param string $error * * @return InvalidWorkflow */ public static function error_updating_workflow( $error ): InvalidWorkflow { return new static( sprintf( 'There was an error updating the workflow: "%s"', $error ) ); } }
|