Total Complexity | 9 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class MonnifyOnFailureValidate |
||
14 | { |
||
15 | private $onFailureValidate; |
||
16 | |||
17 | private static $cache = []; |
||
18 | private const BREAK = "BREAK"; |
||
19 | private const CONTINUE = "CONTINUE"; |
||
20 | |||
21 | /** |
||
22 | * MonnifyOnFailureValidate constructor. |
||
23 | * @param string $onFailureValidate |
||
24 | */ |
||
25 | private function __construct(string $onFailureValidate) |
||
26 | { |
||
27 | $this->onFailureValidate = $onFailureValidate; |
||
28 | } |
||
29 | |||
30 | public static function BREAK(): MonnifyOnFailureValidate |
||
31 | { |
||
32 | if (!key_exists(self::BREAK, self::$cache)) |
||
33 | self::$cache[self::BREAK] = new MonnifyOnFailureValidate( self::BREAK); |
||
34 | return self::$cache[self::BREAK]; |
||
35 | } |
||
36 | |||
37 | public static function CONTINUE(): MonnifyOnFailureValidate |
||
42 | } |
||
43 | |||
44 | public static function findOnFailureValidate(string $onFailureValidate): MonnifyOnFailureValidate |
||
53 | } |
||
54 | } |
||
55 | |||
56 | public function __toString(): string |
||
62 |