2
2
3
3
namespace Studio \Totem \Http \Controllers ;
4
4
5
- use Studio \Totem \Frequency ;
6
5
use Studio \Totem \Task ;
7
6
use Studio \Totem \Totem ;
7
+ use Studio \Totem \Frequency ;
8
8
use Studio \Totem \Contracts \TaskInterface ;
9
9
use Studio \Totem \Http \Requests \TaskRequest ;
10
10
@@ -130,7 +130,7 @@ public function destroy($task)
130
130
}
131
131
132
132
/**
133
- * JSON representation of tasks and their frequencies
133
+ * JSON representation of tasks and their frequencies.
134
134
*
135
135
* @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
136
136
*/
@@ -151,7 +151,7 @@ public function import()
151
151
$ records_imported = 0 ;
152
152
if (request ()->hasFile ('tasks ' )) {
153
153
$ file = request ()->file ('tasks ' );
154
- if (ends_with ($ file ->getClientOriginalName (), '.json ' )) {
154
+ if (ends_with ($ file ->getClientOriginalName (), '.json ' )) {
155
155
try {
156
156
$ data = json_decode (file_get_contents ($ file ->getPathname ()));
157
157
foreach ($ data as $ record ) {
@@ -171,7 +171,7 @@ public function import()
171
171
'notification_slack_webhook ' => $ record ->notification_slack_webhook ,
172
172
]);
173
173
174
- if (!empty ($ record ->frequencies )) {
174
+ if (! empty ($ record ->frequencies )) {
175
175
foreach ($ record ->frequencies as $ freq ) {
176
176
Frequency::updateOrCreate ([
177
177
'id ' => $ freq ->id ,
@@ -190,7 +190,7 @@ public function import()
190
190
}
191
191
}
192
192
193
- if ($ records_imported == 0 ) {
193
+ if ($ records_imported == 0 ) {
194
194
$ errors [] = 'Invalid data or no record selected. ' ;
195
195
}
196
196
0 commit comments