@@ -82,7 +82,7 @@ |
||
| 82 | 82 | { |
| 83 | 83 | $event = $this->schedule->command('sync:caldav '.$calendar->calendar_id)->withoutOverlapping(); |
| 84 | 84 | if($event->isDue($this->laravel)) |
| 85 | - $event->run($this->laravel); |
|
| 85 | + $event->run($this->laravel); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | // |
| 55 | 55 | $calendarId = $this->argument('calendarId'); |
| 56 | - if(is_numeric($calendarId)) |
|
| 56 | + if (is_numeric($calendarId)) |
|
| 57 | 57 | $this->makeForeground(Caldav::findOrFail($calendarId)); |
| 58 | 58 | else |
| 59 | 59 | $this->syncAll(); |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | private function syncAll() |
| 63 | 63 | { |
| 64 | 64 | $calendars = Caldav::all(); |
| 65 | - if($this->option('background')) { |
|
| 65 | + if ($this->option('background')) { |
|
| 66 | 66 | \Log::debug(self::BACKGROUND_MOD_MEX); |
| 67 | 67 | $this->info(self::BACKGROUND_MOD_MEX); |
| 68 | 68 | foreach ($calendars as $calendar) |
| 69 | 69 | $this->makeBackground($calendar); |
| 70 | 70 | \Log::debug(self::BACKGROUND_COMPLETED_MEX); |
| 71 | 71 | $this->info(self::BACKGROUND_COMPLETED_MEX); |
| 72 | - }else |
|
| 73 | - foreach($calendars as $calendar) |
|
| 72 | + } else |
|
| 73 | + foreach ($calendars as $calendar) |
|
| 74 | 74 | $this->makeForeground($calendar); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | private function makeBackground(Caldav $calendar) |
| 82 | 82 | { |
| 83 | 83 | $event = $this->schedule->command('sync:caldav '.$calendar->calendar_id)->withoutOverlapping(); |
| 84 | - if($event->isDue($this->laravel)) |
|
| 84 | + if ($event->isDue($this->laravel)) |
|
| 85 | 85 | $event->run($this->laravel); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | private function makeForeground(Caldav $calendar) |
| 93 | 93 | { |
| 94 | - $this->info('Sync calendar '. $calendar->calendar_id.' started'); |
|
| 94 | + $this->info('Sync calendar '.$calendar->calendar_id.' started'); |
|
| 95 | 95 | (new Sync($calendar))->sync(); |
| 96 | - $this->info('Sync calendar '. $calendar->calendar_id.' completed'); |
|
| 96 | + $this->info('Sync calendar '.$calendar->calendar_id.' completed'); |
|
| 97 | 97 | } |
| 98 | 98 | } |
@@ -53,10 +53,11 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | // |
| 55 | 55 | $calendarId = $this->argument('calendarId'); |
| 56 | - if(is_numeric($calendarId)) |
|
| 57 | - $this->makeForeground(Caldav::findOrFail($calendarId)); |
|
| 58 | - else |
|
| 59 | - $this->syncAll(); |
|
| 56 | + if(is_numeric($calendarId)) { |
|
| 57 | + $this->makeForeground(Caldav::findOrFail($calendarId)); |
|
| 58 | + } else { |
|
| 59 | + $this->syncAll(); |
|
| 60 | + } |
|
| 60 | 61 | } |
| 61 | 62 | |
| 62 | 63 | private function syncAll() |
@@ -65,13 +66,15 @@ discard block |
||
| 65 | 66 | if($this->option('background')) { |
| 66 | 67 | \Log::debug(self::BACKGROUND_MOD_MEX); |
| 67 | 68 | $this->info(self::BACKGROUND_MOD_MEX); |
| 68 | - foreach ($calendars as $calendar) |
|
| 69 | - $this->makeBackground($calendar); |
|
| 69 | + foreach ($calendars as $calendar) { |
|
| 70 | + $this->makeBackground($calendar); |
|
| 71 | + } |
|
| 70 | 72 | \Log::debug(self::BACKGROUND_COMPLETED_MEX); |
| 71 | 73 | $this->info(self::BACKGROUND_COMPLETED_MEX); |
| 72 | - }else |
|
| 73 | - foreach($calendars as $calendar) |
|
| 74 | + } else { |
|
| 75 | + foreach($calendars as $calendar) |
|
| 74 | 76 | $this->makeForeground($calendar); |
| 77 | + } |
|
| 75 | 78 | } |
| 76 | 79 | |
| 77 | 80 | /** |
@@ -81,8 +84,9 @@ discard block |
||
| 81 | 84 | private function makeBackground(Caldav $calendar) |
| 82 | 85 | { |
| 83 | 86 | $event = $this->schedule->command('sync:caldav '.$calendar->calendar_id)->withoutOverlapping(); |
| 84 | - if($event->isDue($this->laravel)) |
|
| 85 | - $event->run($this->laravel); |
|
| 87 | + if($event->isDue($this->laravel)) { |
|
| 88 | + $event->run($this->laravel); |
|
| 89 | + } |
|
| 86 | 90 | } |
| 87 | 91 | |
| 88 | 92 | /** |
@@ -37,19 +37,19 @@ |
||
| 37 | 37 | /** |
| 38 | 38 | * @var array |
| 39 | 39 | */ |
| 40 | - protected $touches = ['calendar']; |
|
| 40 | + protected $touches = [ 'calendar' ]; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * @var array |
| 44 | 44 | */ |
| 45 | - protected $fillable = ['url', 'username', 'password', 'calendar_name']; |
|
| 45 | + protected $fillable = [ 'url', 'username', 'password', 'calendar_name' ]; |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * The attributes excluded from the model's JSON form. |
| 49 | 49 | * |
| 50 | 50 | * @var array |
| 51 | 51 | */ |
| 52 | - protected $hidden = ['password']; |
|
| 52 | + protected $hidden = [ 'password' ]; |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |