@@ -37,7 +37,7 @@  | 
                                                    ||
| 37 | 37 | */  | 
                                                        
| 38 | 38 | public function map(Router $router)  | 
                                                        
| 39 | 39 |      { | 
                                                        
| 40 | -        $router->group(['namespace' => $this->namespace], function ($router) { | 
                                                        |
| 40 | +        $router->group([ 'namespace' => $this->namespace ], function($router) { | 
                                                        |
| 41 | 41 |              require app_path('Http/routes.php'); | 
                                                        
| 42 | 42 | });  | 
                                                        
| 43 | 43 | }  | 
                                                        
@@ -51,14 +51,14 @@  | 
                                                    ||
| 51 | 51 | *  | 
                                                        
| 52 | 52 | * @var array  | 
                                                        
| 53 | 53 | */  | 
                                                        
| 54 | - protected $fillable = ['name', 'email', 'password'];  | 
                                                        |
| 54 | + protected $fillable = [ 'name', 'email', 'password' ];  | 
                                                        |
| 55 | 55 | |
| 56 | 56 | /**  | 
                                                        
| 57 | 57 | * The attributes excluded from the model's JSON form.  | 
                                                        
| 58 | 58 | *  | 
                                                        
| 59 | 59 | * @var array  | 
                                                        
| 60 | 60 | */  | 
                                                        
| 61 | - protected $hidden = ['password', 'remember_token'];  | 
                                                        |
| 61 | + protected $hidden = [ 'password', 'remember_token' ];  | 
                                                        |
| 62 | 62 | |
| 63 | 63 | public function company()  | 
                                                        
| 64 | 64 |      { | 
                                                        
@@ -20,8 +20,8 @@  | 
                                                    ||
| 20 | 20 | */  | 
                                                        
| 21 | 21 | public function __construct()  | 
                                                        
| 22 | 22 |      { | 
                                                        
| 23 | - config(['auth.model' => \plunner\Company::class]);  | 
                                                        |
| 24 | - config(['jwt.user' => \plunner\Company::class]);  | 
                                                        |
| 23 | + config([ 'auth.model' => \plunner\Company::class ]);  | 
                                                        |
| 24 | + config([ 'jwt.user' => \plunner\Company::class ]);  | 
                                                        |
| 25 | 25 |          $this->middleware('jwt.authandrefresh:mode-cn'); | 
                                                        
| 26 | 26 | }  | 
                                                        
| 27 | 27 | |
@@ -1,21 +1,21 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | /**  | 
                                                        
| 3 | - * Created by PhpStorm.  | 
                                                        |
| 4 | - * User: Claudio Cardinale <[email protected]>  | 
                                                        |
| 5 | - * Date: 24/11/15  | 
                                                        |
| 6 | - * Time: 21.58  | 
                                                        |
| 7 | - * This program is free software; you can redistribute it and/or  | 
                                                        |
| 8 | - * modify it under the terms of the GNU General Public License  | 
                                                        |
| 9 | - * as published by the Free Software Foundation; either version 2  | 
                                                        |
| 10 | - * of the License, or (at your option) any later version.  | 
                                                        |
| 11 | - * This program is distributed in the hope that it will be useful,  | 
                                                        |
| 12 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of  | 
                                                        |
| 13 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  | 
                                                        |
| 14 | - * GNU General Public License for more details.  | 
                                                        |
| 15 | - * You should have received a copy of the GNU General Public License  | 
                                                        |
| 16 | - * along with this program; if not, write to the Free Software  | 
                                                        |
| 17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  | 
                                                        |
| 18 | - */  | 
                                                        |
| 3 | + * Created by PhpStorm.  | 
                                                        |
| 4 | + * User: Claudio Cardinale <[email protected]>  | 
                                                        |
| 5 | + * Date: 24/11/15  | 
                                                        |
| 6 | + * Time: 21.58  | 
                                                        |
| 7 | + * This program is free software; you can redistribute it and/or  | 
                                                        |
| 8 | + * modify it under the terms of the GNU General Public License  | 
                                                        |
| 9 | + * as published by the Free Software Foundation; either version 2  | 
                                                        |
| 10 | + * of the License, or (at your option) any later version.  | 
                                                        |
| 11 | + * This program is distributed in the hope that it will be useful,  | 
                                                        |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of  | 
                                                        |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  | 
                                                        |
| 14 | + * GNU General Public License for more details.  | 
                                                        |
| 15 | + * You should have received a copy of the GNU General Public License  | 
                                                        |
| 16 | + * along with this program; if not, write to the Free Software  | 
                                                        |
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  | 
                                                        |
| 18 | + */  | 
                                                        |
| 19 | 19 | |
| 20 | 20 | namespace plunner;  | 
                                                        
| 21 | 21 | |
@@ -1,21 +1,21 @@  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 | /**  | 
                                                        
| 3 | - * Created by PhpStorm.  | 
                                                        |
| 4 | - * User: Claudio Cardinale <[email protected]>  | 
                                                        |
| 5 | - * Date: 03/12/15  | 
                                                        |
| 6 | - * Time: 2.33  | 
                                                        |
| 7 | - * This program is free software; you can redistribute it and/or  | 
                                                        |
| 8 | - * modify it under the terms of the GNU General Public License  | 
                                                        |
| 9 | - * as published by the Free Software Foundation; either version 2  | 
                                                        |
| 10 | - * of the License, or (at your option) any later version.  | 
                                                        |
| 11 | - * This program is distributed in the hope that it will be useful,  | 
                                                        |
| 12 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of  | 
                                                        |
| 13 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  | 
                                                        |
| 14 | - * GNU General Public License for more details.  | 
                                                        |
| 15 | - * You should have received a copy of the GNU General Public License  | 
                                                        |
| 16 | - * along with this program; if not, write to the Free Software  | 
                                                        |
| 17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  | 
                                                        |
| 18 | - */  | 
                                                        |
| 3 | + * Created by PhpStorm.  | 
                                                        |
| 4 | + * User: Claudio Cardinale <[email protected]>  | 
                                                        |
| 5 | + * Date: 03/12/15  | 
                                                        |
| 6 | + * Time: 2.33  | 
                                                        |
| 7 | + * This program is free software; you can redistribute it and/or  | 
                                                        |
| 8 | + * modify it under the terms of the GNU General Public License  | 
                                                        |
| 9 | + * as published by the Free Software Foundation; either version 2  | 
                                                        |
| 10 | + * of the License, or (at your option) any later version.  | 
                                                        |
| 11 | + * This program is distributed in the hope that it will be useful,  | 
                                                        |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of  | 
                                                        |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  | 
                                                        |
| 14 | + * GNU General Public License for more details.  | 
                                                        |
| 15 | + * You should have received a copy of the GNU General Public License  | 
                                                        |
| 16 | + * along with this program; if not, write to the Free Software  | 
                                                        |
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  | 
                                                        |
| 18 | + */  | 
                                                        |
| 19 | 19 | |
| 20 | 20 | namespace plunner\Console\Commands\SyncCaldav;  | 
                                                        
| 21 | 21 | |
@@ -108,7 +108,7 @@ discard block  | 
                                                    ||
| 108 | 108 | $caldavClient = new SimpleCaldavAdapter();  | 
                                                        
| 109 | 109 | $caldavClient->connect($this->calendar->url, $this->calendar->username, \Crypt::decrypt($this->calendar->password));  | 
                                                        
| 110 | 110 | $calendars = $caldavClient->findCalendars();  | 
                                                        
| 111 | - $caldavClient->setCalendar($calendars[$this->calendar->calendar_name]);//TODO error if the calendar name is wrong  | 
                                                        |
| 111 | + $caldavClient->setCalendar($calendars[ $this->calendar->calendar_name ]); //TODO error if the calendar name is wrong  | 
                                                        |
| 112 | 112 | /**  | 
                                                        
| 113 | 113 | * 26 hours before to avoid tiemezone problems and dst problems  | 
                                                        
| 114 | 114 | * 30 days after  | 
                                                        
@@ -124,15 +124,15 @@ discard block  | 
                                                    ||
| 124 | 124 |      { | 
                                                        
| 125 | 125 | $pattern = "/^((DTSTART;)|(DTEND;))(.*)\$/m";  | 
                                                        
| 126 | 126 |          if (preg_match_all($pattern, $event->getData(), $matches)) { | 
                                                        
| 127 | - if (!isset($matches[4]) || count($matches[4]) != 2)  | 
                                                        |
| 127 | + if (!isset($matches[ 4 ]) || count($matches[ 4 ]) != 2)  | 
                                                        |
| 128 | 128 | return null;  | 
                                                        
| 129 | - $ret = [];  | 
                                                        |
| 130 | - if ($tmp = $this->parseDate($matches[4][0]))  | 
                                                        |
| 131 | - $ret['time_start'] = $tmp;  | 
                                                        |
| 129 | + $ret = [ ];  | 
                                                        |
| 130 | + if ($tmp = $this->parseDate($matches[ 4 ][ 0 ]))  | 
                                                        |
| 131 | + $ret[ 'time_start' ] = $tmp;  | 
                                                        |
| 132 | 132 | else  | 
                                                        
| 133 | 133 | return null;  | 
                                                        
| 134 | - if ($tmp = $this->parseDate($matches[4][1]))  | 
                                                        |
| 135 | - $ret['time_end'] = $tmp;  | 
                                                        |
| 134 | + if ($tmp = $this->parseDate($matches[ 4 ][ 1 ]))  | 
                                                        |
| 135 | + $ret[ 'time_end' ] = $tmp;  | 
                                                        |
| 136 | 136 | else  | 
                                                        
| 137 | 137 | return null;  | 
                                                        
| 138 | 138 | return $ret;  | 
                                                        
@@ -148,10 +148,10 @@ discard block  | 
                                                    ||
| 148 | 148 |      { | 
                                                        
| 149 | 149 | $pattern = "/^((TZID=)|(VALUE=))(.*):(.*)\$/m";  | 
                                                        
| 150 | 150 |          if (preg_match_all($pattern, $date, $matches)) { | 
                                                        
| 151 | -            if ($matches[1][0] == 'TZID=') { | 
                                                        |
| 152 | -                return \DateTime::createFromFormat('Ymd\THis', $matches[5][0], new \DateTimeZone($matches[4][0])); | 
                                                        |
| 153 | -            } else if ($matches[1][0] == 'VALUE=' && $matches[4][0] == 'DATE') { | 
                                                        |
| 154 | -                return \DateTime::createFromFormat('Ymd\THis', $matches[5][0] . 'T000000'); | 
                                                        |
| 151 | +            if ($matches[ 1 ][ 0 ] == 'TZID=') { | 
                                                        |
| 152 | +                return \DateTime::createFromFormat('Ymd\THis', $matches[ 5 ][ 0 ], new \DateTimeZone($matches[ 4 ][ 0 ])); | 
                                                        |
| 153 | +            } else if ($matches[ 1 ][ 0 ] == 'VALUE=' && $matches[ 4 ][ 0 ] == 'DATE') { | 
                                                        |
| 154 | +                return \DateTime::createFromFormat('Ymd\THis', $matches[ 5 ][ 0 ].'T000000'); | 
                                                        |
| 155 | 155 | }  | 
                                                        
| 156 | 156 | }  | 
                                                        
| 157 | 157 | return null;  | 
                                                        
@@ -89,10 +89,11 @@ discard block  | 
                                                    ||
| 89 | 89 | |
| 90 | 90 | //insert new timeslots  | 
                                                        
| 91 | 91 |          foreach ($events as $event) { | 
                                                        
| 92 | - if (!($event = $this->parseEvent($event)))  | 
                                                        |
| 93 | - \Event::fire(new ErrorEvent($this->calendar, 'problem during the parsing an event'));  | 
                                                        |
| 94 | - else  | 
                                                        |
| 95 | - $calendarMain->timeslots()->create($event);  | 
                                                        |
| 92 | +            if (!($event = $this->parseEvent($event))) { | 
                                                        |
| 93 | + \Event::fire(new ErrorEvent($this->calendar, 'problem during the parsing an event'));  | 
                                                        |
| 94 | +            } else { | 
                                                        |
| 95 | + $calendarMain->timeslots()->create($event);  | 
                                                        |
| 96 | + }  | 
                                                        |
| 96 | 97 | }  | 
                                                        
| 97 | 98 | \Event::fire(new OkEvent($this->calendar));  | 
                                                        
| 98 | 99 | }  | 
                                                        
@@ -124,17 +125,20 @@ discard block  | 
                                                    ||
| 124 | 125 |      { | 
                                                        
| 125 | 126 | $pattern = "/^((DTSTART;)|(DTEND;))(.*)\$/m";  | 
                                                        
| 126 | 127 |          if (preg_match_all($pattern, $event->getData(), $matches)) { | 
                                                        
| 127 | - if (!isset($matches[4]) || count($matches[4]) != 2)  | 
                                                        |
| 128 | - return null;  | 
                                                        |
| 128 | +            if (!isset($matches[4]) || count($matches[4]) != 2) { | 
                                                        |
| 129 | + return null;  | 
                                                        |
| 130 | + }  | 
                                                        |
| 129 | 131 | $ret = [];  | 
                                                        
| 130 | - if ($tmp = $this->parseDate($matches[4][0]))  | 
                                                        |
| 131 | - $ret['time_start'] = $tmp;  | 
                                                        |
| 132 | - else  | 
                                                        |
| 133 | - return null;  | 
                                                        |
| 134 | - if ($tmp = $this->parseDate($matches[4][1]))  | 
                                                        |
| 135 | - $ret['time_end'] = $tmp;  | 
                                                        |
| 136 | - else  | 
                                                        |
| 137 | - return null;  | 
                                                        |
| 132 | +            if ($tmp = $this->parseDate($matches[4][0])) { | 
                                                        |
| 133 | + $ret['time_start'] = $tmp;  | 
                                                        |
| 134 | +            } else { | 
                                                        |
| 135 | + return null;  | 
                                                        |
| 136 | + }  | 
                                                        |
| 137 | +            if ($tmp = $this->parseDate($matches[4][1])) { | 
                                                        |
| 138 | + $ret['time_end'] = $tmp;  | 
                                                        |
| 139 | +            } else { | 
                                                        |
| 140 | + return null;  | 
                                                        |
| 141 | + }  | 
                                                        |
| 138 | 142 | return $ret;  | 
                                                        
| 139 | 143 | }  | 
                                                        
| 140 | 144 | return null;  | 
                                                        
@@ -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  | 
                                                        
@@ -37,7 +37,7 @@  | 
                                                    ||
| 37 | 37 | *  | 
                                                        
| 38 | 38 | * @var array  | 
                                                        
| 39 | 39 | */  | 
                                                        
| 40 | - protected $fillable = ['name', 'enabled'];  | 
                                                        |
| 40 | + protected $fillable = [ 'name', 'enabled' ];  | 
                                                        |
| 41 | 41 | |
| 42 | 42 | /**  | 
                                                        
| 43 | 43 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo  | 
                                                        
@@ -46,14 +46,14 @@  | 
                                                    ||
| 46 | 46 | *  | 
                                                        
| 47 | 47 | * @var array  | 
                                                        
| 48 | 48 | */  | 
                                                        
| 49 | - protected $fillable = ['title', 'description', 'duration'];  | 
                                                        |
| 49 | + protected $fillable = [ 'title', 'description', 'duration' ];  | 
                                                        |
| 50 | 50 | |
| 51 | 51 | /**  | 
                                                        
| 52 | 52 | * The attributes excluded from the model's JSON form.  | 
                                                        
| 53 | 53 | *  | 
                                                        
| 54 | 54 | * @var array  | 
                                                        
| 55 | 55 | */  | 
                                                        
| 56 | - protected $hidden = ['pivot'];  | 
                                                        |
| 56 | + protected $hidden = [ 'pivot' ];  | 
                                                        |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | /**  | 
                                                        
@@ -39,6 +39,6 @@  | 
                                                    ||
| 39 | 39 | */  | 
                                                        
| 40 | 40 | public function broadcastOn()  | 
                                                        
| 41 | 41 |      { | 
                                                        
| 42 | - return [];  | 
                                                        |
| 42 | + return [ ];  | 
                                                        |
| 43 | 43 | }  | 
                                                        
| 44 | 44 | }  |