@@ -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 |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | $caldavClient = new SimpleCaldavAdapter(); |
111 | 111 | $caldavClient->connect($this->calendar->url, $this->calendar->username, \Crypt::decrypt($this->calendar->password)); |
112 | 112 | $calendars = $caldavClient->findCalendars(); |
113 | - if(!isset($calendars[$this->calendar->calendar_name])) |
|
113 | + if (!isset($calendars[ $this->calendar->calendar_name ])) |
|
114 | 114 | throw new CaldavException("calendar inserted doesn't exist"); |
115 | - $caldavClient->setCalendar($calendars[$this->calendar->calendar_name]);//TODO error if the calendar name is wrong |
|
115 | + $caldavClient->setCalendar($calendars[ $this->calendar->calendar_name ]); //TODO error if the calendar name is wrong |
|
116 | 116 | /** |
117 | 117 | * 26 hours before to avoid tiemezone problems and dst problems |
118 | 118 | * 30 days after |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | { |
129 | 129 | $pattern = "/^((DTSTART;)|(DTEND;))(.*)\$/m"; |
130 | 130 | if (preg_match_all($pattern, $event->getData(), $matches)) { |
131 | - if (!isset($matches[4]) || count($matches[4]) != 2) |
|
131 | + if (!isset($matches[ 4 ]) || count($matches[ 4 ]) != 2) |
|
132 | 132 | return null; |
133 | - $ret = []; |
|
134 | - if ($tmp = $this->parseDate($matches[4][0])) |
|
135 | - $ret['time_start'] = $tmp; |
|
133 | + $ret = [ ]; |
|
134 | + if ($tmp = $this->parseDate($matches[ 4 ][ 0 ])) |
|
135 | + $ret[ 'time_start' ] = $tmp; |
|
136 | 136 | else |
137 | 137 | return null; |
138 | - if ($tmp = $this->parseDate($matches[4][1])) |
|
139 | - $ret['time_end'] = $tmp; |
|
138 | + if ($tmp = $this->parseDate($matches[ 4 ][ 1 ])) |
|
139 | + $ret[ 'time_end' ] = $tmp; |
|
140 | 140 | else |
141 | 141 | return null; |
142 | 142 | return $ret; |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | { |
153 | 153 | $pattern = "/^((TZID=)|(VALUE=))(.*):(.*)\$/m"; |
154 | 154 | if (preg_match_all($pattern, $date, $matches)) { |
155 | - if ($matches[1][0] == 'TZID=') { |
|
156 | - return \DateTime::createFromFormat('Ymd\THis', $matches[5][0], new \DateTimeZone($matches[4][0])); |
|
157 | - } else if ($matches[1][0] == 'VALUE=' && $matches[4][0] == 'DATE') { |
|
158 | - return \DateTime::createFromFormat('Ymd\THis', $matches[5][0] . 'T000000'); |
|
155 | + if ($matches[ 1 ][ 0 ] == 'TZID=') { |
|
156 | + return \DateTime::createFromFormat('Ymd\THis', $matches[ 5 ][ 0 ], new \DateTimeZone($matches[ 4 ][ 0 ])); |
|
157 | + } else if ($matches[ 1 ][ 0 ] == 'VALUE=' && $matches[ 4 ][ 0 ] == 'DATE') { |
|
158 | + return \DateTime::createFromFormat('Ymd\THis', $matches[ 5 ][ 0 ].'T000000'); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | return null; |
@@ -90,10 +90,11 @@ discard block |
||
90 | 90 | |
91 | 91 | //insert new timeslots |
92 | 92 | foreach ($events as $event) { |
93 | - if (!($event = $this->parseEvent($event))) |
|
94 | - \Event::fire(new ErrorEvent($this->calendar, 'problem during the parsing an event')); |
|
95 | - else |
|
96 | - $calendarMain->timeslots()->create($event); |
|
93 | + if (!($event = $this->parseEvent($event))) { |
|
94 | + \Event::fire(new ErrorEvent($this->calendar, 'problem during the parsing an event')); |
|
95 | + } else { |
|
96 | + $calendarMain->timeslots()->create($event); |
|
97 | + } |
|
97 | 98 | } |
98 | 99 | \Event::fire(new OkEvent($this->calendar)); |
99 | 100 | } |
@@ -110,8 +111,9 @@ discard block |
||
110 | 111 | $caldavClient = new SimpleCaldavAdapter(); |
111 | 112 | $caldavClient->connect($this->calendar->url, $this->calendar->username, \Crypt::decrypt($this->calendar->password)); |
112 | 113 | $calendars = $caldavClient->findCalendars(); |
113 | - if(!isset($calendars[$this->calendar->calendar_name])) |
|
114 | - throw new CaldavException("calendar inserted doesn't exist"); |
|
114 | + if(!isset($calendars[$this->calendar->calendar_name])) { |
|
115 | + throw new CaldavException("calendar inserted doesn't exist"); |
|
116 | + } |
|
115 | 117 | $caldavClient->setCalendar($calendars[$this->calendar->calendar_name]);//TODO error if the calendar name is wrong |
116 | 118 | /** |
117 | 119 | * 26 hours before to avoid tiemezone problems and dst problems |
@@ -128,17 +130,20 @@ discard block |
||
128 | 130 | { |
129 | 131 | $pattern = "/^((DTSTART;)|(DTEND;))(.*)\$/m"; |
130 | 132 | if (preg_match_all($pattern, $event->getData(), $matches)) { |
131 | - if (!isset($matches[4]) || count($matches[4]) != 2) |
|
132 | - return null; |
|
133 | + if (!isset($matches[4]) || count($matches[4]) != 2) { |
|
134 | + return null; |
|
135 | + } |
|
133 | 136 | $ret = []; |
134 | - if ($tmp = $this->parseDate($matches[4][0])) |
|
135 | - $ret['time_start'] = $tmp; |
|
136 | - else |
|
137 | - return null; |
|
138 | - if ($tmp = $this->parseDate($matches[4][1])) |
|
139 | - $ret['time_end'] = $tmp; |
|
140 | - else |
|
141 | - return null; |
|
137 | + if ($tmp = $this->parseDate($matches[4][0])) { |
|
138 | + $ret['time_start'] = $tmp; |
|
139 | + } else { |
|
140 | + return null; |
|
141 | + } |
|
142 | + if ($tmp = $this->parseDate($matches[4][1])) { |
|
143 | + $ret['time_end'] = $tmp; |
|
144 | + } else { |
|
145 | + return null; |
|
146 | + } |
|
142 | 147 | return $ret; |
143 | 148 | } |
144 | 149 | 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 | } |