These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Composer update checker job. Runs the check as a queuedjob. |
||
4 | * |
||
5 | * @author Peter Thaleikis |
||
6 | * @license MIT |
||
7 | */ |
||
8 | class CheckComposerUpdatesJob extends AbstractQueuedJob implements QueuedJob |
||
9 | { |
||
10 | /** |
||
11 | * The task to run |
||
12 | * |
||
13 | * @var BuildTask |
||
14 | */ |
||
15 | protected $task; |
||
16 | |||
17 | /** |
||
18 | * define the title |
||
19 | * |
||
20 | * @return string |
||
21 | */ |
||
22 | public function getTitle() |
||
23 | { |
||
24 | return _t( |
||
25 | 'ComposerUpdateChecker.Title', |
||
26 | 'Check if composer updates are available' |
||
27 | ); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * define the type. |
||
32 | */ |
||
33 | public function getJobType() |
||
34 | { |
||
35 | $this->totalSteps = 1; |
||
36 | |||
37 | return QueuedJob::QUEUED; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * init |
||
42 | */ |
||
43 | public function setup() |
||
44 | { |
||
45 | // create the instance of the task |
||
46 | $this->task = new CheckComposerUpdatesTask(); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * processes the task as a job |
||
51 | */ |
||
52 | public function process() |
||
53 | { |
||
54 | // run the task |
||
55 | $this->task->run(new SS_HTTPRequest()); |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
56 | |||
57 | // mark job as completed |
||
58 | $this->isComplete = true; |
||
59 | } |
||
60 | } |
||
61 |