Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
33.33% |
2 / 6 |
|
33.33% |
2 / 6 |
CRAP | |
0.00% |
0 / 1 |
| Task_Updated | |
33.33% |
2 / 6 |
|
33.33% |
2 / 6 |
16.67 | |
0.00% |
0 / 1 |
| get_slug | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_title | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_description | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_category | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_data_type | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| listen_to_event | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Jetpack CRM Automation Task_Updated trigger. |
| 4 | * |
| 5 | * @package automattic/jetpack-crm |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\Jetpack\CRM\Automation\Triggers; |
| 9 | |
| 10 | use Automattic\Jetpack\CRM\Automation\Base_Trigger; |
| 11 | use Automattic\Jetpack\CRM\Automation\Data_Types\Task_Data; |
| 12 | |
| 13 | /** |
| 14 | * Adds the Task_Updated class. |
| 15 | * |
| 16 | * @since 6.2.0 |
| 17 | */ |
| 18 | class Task_Updated extends Base_Trigger { |
| 19 | |
| 20 | /** |
| 21 | * Get the slug name of the trigger. |
| 22 | * |
| 23 | * @since 6.2.0 |
| 24 | * |
| 25 | * @return string The trigger slug. |
| 26 | */ |
| 27 | public static function get_slug(): string { |
| 28 | return 'jpcrm/task_updated'; |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Get the title of the trigger. |
| 33 | * |
| 34 | * @since 6.2.0 |
| 35 | * |
| 36 | * @return string The title. |
| 37 | */ |
| 38 | public static function get_title(): string { |
| 39 | return __( 'Task Updated', 'zero-bs-crm' ); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Get the description of the trigger. |
| 44 | * |
| 45 | * @since 6.2.0 |
| 46 | * |
| 47 | * @return string The description. |
| 48 | */ |
| 49 | public static function get_description(): string { |
| 50 | return __( 'Triggered when a task is updated', 'zero-bs-crm' ); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Get the category of the trigger. |
| 55 | * |
| 56 | * @since 6.2.0 |
| 57 | * |
| 58 | * @return string The category. |
| 59 | */ |
| 60 | public static function get_category(): string { |
| 61 | return __( 'Task', 'zero-bs-crm' ); |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Get the date type. |
| 66 | * |
| 67 | * @return string The type of the step |
| 68 | */ |
| 69 | public static function get_data_type(): string { |
| 70 | return Task_Data::class; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Listen to this trigger's target event. |
| 75 | * |
| 76 | * @since 6.2.0 |
| 77 | * |
| 78 | * @return void |
| 79 | */ |
| 80 | protected function listen_to_event(): void { |
| 81 | $this->listen_to_wp_action( 'jpcrm_task_updated' ); |
| 82 | } |
| 83 | } |