PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.8.1
GiveWP – Donation Plugin and Fundraising Platform v4.16.8.1
4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 All 254 releases
give / src / MigrationLog / MigrationLogStatus.php

MigrationLogStatus.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.8.1, at src/MigrationLog/MigrationLogStatus.php

53 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\MigrationLog;
4
5 /**
6 * Class MigrationLogStatus
7 * @package Give\MigrationLog
8 *
9 * @since 4.3.0 add REVERSED status
10 * @since 4.0.0 add RUNNING and INCOMPLETE statuses
11 * @since 2.10.0
12 */
13 class MigrationLogStatus
14 {
15 const SUCCESS = 'success';
16 const FAILED = 'failed';
17 const PENDING = 'pending';
18 const RUNNING = 'running';
19 const INCOMPLETE = 'incomplete';
20 const REVERSED = 'reversed';
21
22 /**
23 * Get default migration status
24 */
25 public static function getDefault(): string
26 {
27 return MigrationLogStatus::FAILED;
28 }
29
30 /**
31 * Get all migration statuses
32 */
33 public static function getAll(): array
34 {
35 return [
36 MigrationLogStatus::SUCCESS => esc_html__('Success', 'give'),
37 MigrationLogStatus::FAILED => esc_html__('Failed', 'give'),
38 MigrationLogStatus::PENDING => esc_html__('Pending', 'give'),
39 MigrationLogStatus::RUNNING => esc_html__('Running', 'give'),
40 MigrationLogStatus::INCOMPLETE => esc_html__('Incomplete', 'give'),
41 MigrationLogStatus::REVERSED => esc_html__('Pending', 'give'),
42 ];
43 }
44
45 /**
46 * Check if value is a valid migration status
47 */
48 public static function isValid(string $status): bool
49 {
50 return array_key_exists($status, self::getAll());
51 }
52 }
53