1 | <?php |
||
9 | class SyncCaldav extends Command |
||
10 | { |
||
11 | const BACKGROUND_MOD_MEX = 'background mode'; |
||
12 | const BACKGROUND_COMPLETED_MEX = 'All background tasks started'; |
||
13 | |||
14 | /** |
||
15 | * The name and signature of the console command. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $signature = 'sync:caldav {calendarId?} {--background}'; |
||
20 | |||
21 | /** |
||
22 | * The console command description. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $description = 'Sync caldav accounts'; |
||
27 | |||
28 | |||
29 | /** |
||
30 | * @var Schedule laravel schedule object needed to perform command in background |
||
31 | */ |
||
32 | private $schedule; |
||
33 | |||
34 | |||
35 | /** |
||
36 | * Create a new command instance. |
||
37 | * @param Schedule $schedule |
||
38 | * |
||
39 | * @return void |
||
|
|||
40 | */ |
||
41 | 6 | public function __construct(Schedule $schedule) |
|
46 | |||
47 | /** |
||
48 | * Execute the console command. |
||
49 | * |
||
50 | * @return mixed |
||
51 | */ |
||
52 | 6 | public function handle() |
|
61 | |||
62 | 6 | private function syncAll() |
|
76 | |||
77 | /** |
||
78 | * sync calendars via exec command |
||
79 | * @param Caldav $calendar |
||
80 | */ |
||
81 | 2 | private function makeBackground(Caldav $calendar) |
|
87 | |||
88 | /** |
||
89 | * sync calendars foreground |
||
90 | * @param Caldav $calendar |
||
91 | */ |
||
92 | 4 | private function makeForeground(Caldav $calendar) |
|
98 | } |
||
99 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.