-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathExtensionHandler.php
111 lines (97 loc) · 2.64 KB
/
ExtensionHandler.php
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
/*
* This file is part of the zenstruck/schedule-bundle package.
*
* (c) Kevin Bond <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Zenstruck\ScheduleBundle\Schedule\Extension;
use Zenstruck\ScheduleBundle\Schedule\Exception\SkipSchedule;
use Zenstruck\ScheduleBundle\Schedule\Exception\SkipTask;
use Zenstruck\ScheduleBundle\Schedule\ScheduleRunContext;
use Zenstruck\ScheduleBundle\Schedule\Task\TaskRunContext;
/**
* @author Kevin Bond <[email protected]>
*/
abstract class ExtensionHandler
{
/**
* Skip entire schedule if \Zenstruck\ScheduleBundle\Schedule\Exception\SkipSchedule
* exception is thrown.
*
* @throws SkipSchedule
*/
public function filterSchedule(ScheduleRunContext $context, object $extension): void
{
// noop
}
/**
* Executes before the schedule runs.
*/
public function beforeSchedule(ScheduleRunContext $context, object $extension): void
{
// noop
}
/**
* Executes after the schedule runs.
*/
public function afterSchedule(ScheduleRunContext $context, object $extension): void
{
// noop
}
/**
* Executes if the schedule ran with no failures.
*/
public function onScheduleSuccess(ScheduleRunContext $context, object $extension): void
{
// noop
}
/**
* Executes if the schedule ran with failures.
*/
public function onScheduleFailure(ScheduleRunContext $context, object $extension): void
{
// noop
}
/**
* Skip task if \Zenstruck\ScheduleBundle\Schedule\Exception\SkipTask exception
* is thrown.
*
* @throws SkipTask
*/
public function filterTask(TaskRunContext $context, object $extension): void
{
// noop
}
/**
* Executes before the task runs (not if skipped).
*/
public function beforeTask(TaskRunContext $context, object $extension): void
{
// noop
}
/**
* Executes after the task runs (not if skipped).
*/
public function afterTask(TaskRunContext $context, object $extension): void
{
// noop
}
/**
* Executes if the task ran successfully (not if skipped).
*/
public function onTaskSuccess(TaskRunContext $context, object $extension): void
{
// noop
}
/**
* Executes if the task failed (not if skipped).
*/
public function onTaskFailure(TaskRunContext $context, object $extension): void
{
// noop
}
abstract public function supports(object $extension): bool;
}