Skip to content

Commit 3853a78

Browse files
authored
fix : styleci
1 parent d4e999f commit 3853a78

File tree

13 files changed

+43
-53
lines changed

13 files changed

+43
-53
lines changed

routes/web.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
Route::get('/', 'DashboardController@index')->name('totem.dashboard');
1111

1212
Route::group(['prefix' => 'tasks'], function () {
13-
1413
Route::get('/', 'TasksController@index')->name('totem.tasks.all');
1514

1615
Route::get('create', 'TasksController@create')->name('totem.task.create');
17-
Route::post('create', 'TasksController@store');;
16+
Route::post('create', 'TasksController@store');
1817

1918
Route::get('export', 'ExportTasksController@index')->name('totem.tasks.export');
2019
Route::post('import', 'ImportTasksController@index')->name('totem.tasks.import');

src/Events/BroadcastingEvent.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<?php
22

3-
43
namespace Studio\Totem\Events;
54

6-
7-
use Illuminate\Broadcasting\InteractsWithSockets;
5+
use Studio\Totem\Task;
86
use Illuminate\Broadcasting\PrivateChannel;
7+
use Illuminate\Broadcasting\InteractsWithSockets;
98
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
10-
use Studio\Totem\Task;
119

1210
class BroadcastingEvent extends Event implements ShouldBroadcast
1311
{
@@ -37,4 +35,4 @@ public function broadcastOn()
3735
{
3836
return new PrivateChannel('task.events');
3937
}
40-
}
38+
}

src/Events/Deleted.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Studio\Totem\Events;
44

5-
65
class Deleted extends Event
76
{
87
/**
@@ -13,6 +12,5 @@ class Deleted extends Event
1312
*/
1413
public function __construct()
1514
{
16-
1715
}
1816
}

src/Events/Deleting.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?php
22

3-
43
namespace Studio\Totem\Events;
54

65
class Deleting extends Event
76
{
8-
9-
}
7+
}

src/Http/Controllers/ExportTasksController.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
namespace Studio\Totem\Http\Controllers;
44

55
use File;
6-
use function fwrite;
7-
use Storage;
86
use function storage_path;
97
use Studio\Totem\Contracts\TaskInterface;
108

@@ -27,15 +25,16 @@ public function __construct(TaskInterface $tasks)
2725
}
2826

2927
/**
30-
* Export all tasks to a json file
28+
* Export all tasks to a json file.
3129
*
3230
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
3331
*/
3432
public function index()
3533
{
36-
File::put(storage_path("tasks.json"), $this->tasks->findAll()->toJson());
34+
File::put(storage_path('tasks.json'), $this->tasks->findAll()->toJson());
35+
3736
return response()
38-
->download(storage_path("tasks.json"), "tasks.json")
37+
->download(storage_path('tasks.json'), 'tasks.json')
3938
->deleteFileAfterSend(true);
4039
}
41-
}
40+
}

src/Http/Controllers/ImportTasksController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
namespace Studio\Totem\Http\Controllers;
54

65
use Studio\Totem\Contracts\TaskInterface;
@@ -25,12 +24,12 @@ public function __construct(TaskInterface $tasks)
2524
}
2625

2726
/**
28-
* Import tasks from a json file
27+
* Import tasks from a json file.
2928
* @param \Studio\Totem\Http\Requests\ImportRequest $request
3029
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
3130
*/
3231
public function index(ImportRequest $request)
3332
{
3433
$this->tasks->import($request->validated());
3534
}
36-
}
35+
}

src/Http/Requests/ImportRequest.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<?php
22

3-
43
namespace Studio\Totem\Http\Requests;
54

65
use Illuminate\Foundation\Http\FormRequest;
7-
use Illuminate\Http\Exceptions\HttpResponseException;
8-
use Illuminate\Http\UploadedFile;
96
use Illuminate\Contracts\Validation\Validator;
7+
use Illuminate\Http\Exceptions\HttpResponseException;
108

119
class ImportRequest extends FormRequest
1210
{
@@ -19,6 +17,7 @@ public function authorize()
1917
{
2018
return true;
2119
}
20+
2221
/**
2322
* Get the validation rules that apply to the request.
2423
*
@@ -28,7 +27,7 @@ public function rules()
2827
{
2928
return [
3029
'tasks' => 'required|file|jsonFile',
31-
'content' => 'json'
30+
'content' => 'json',
3231
];
3332
}
3433

@@ -43,7 +42,7 @@ public function messages()
4342
'tasks.required' => 'Please select a file to import',
4443
'tasks.file' => 'Please select a file to import',
4544
'tasks.json_file' => 'Please select a json file',
46-
'content' => 'File does not contain valid json'
45+
'content' => 'File does not contain valid json',
4746
];
4847
}
4948

@@ -56,7 +55,7 @@ public function messages()
5655
*/
5756
public function all($keys = null)
5857
{
59-
$content = "";
58+
$content = '';
6059

6160
if ($jsonFile = $this->file('tasks')) {
6261
$content = $jsonFile->get();
@@ -73,7 +72,7 @@ public function all($keys = null)
7372
*/
7473
public function validated()
7574
{
76-
$content = "";
75+
$content = '';
7776

7877
if ($jsonFile = $this->file('tasks')) {
7978
$content = $jsonFile->get();
@@ -82,7 +81,6 @@ public function validated()
8281
return array_merge(parent::validated(), compact('content'));
8382
}
8483

85-
8684
/**
8785
* * Handle a failed validation attempt.
8886
*
@@ -92,4 +90,4 @@ protected function failedValidation(Validator $validator)
9290
{
9391
throw new HttpResponseException(response()->json($validator->errors(), 422));
9492
}
95-
}
93+
}

src/Listeners/BuildCache.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?php
22

3-
43
namespace Studio\Totem\Listeners;
54

6-
75
use Studio\Totem\Events\Event;
86

97
class BuildCache extends Listener
@@ -29,4 +27,4 @@ protected function build(Event $event)
2927
$this->tasks->find($event->task->id);
3028
}
3129
}
32-
}
30+
}

src/Providers/TotemRouteServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class TotemRouteServiceProvider extends RouteServiceProvider
2525
public function boot()
2626
{
2727
parent::boot();
28-
Route::bind('task', function($value) {
29-
return cache()->rememberForever('totem.task.' . $value, function () use ($value) {
28+
Route::bind('task', function ($value) {
29+
return cache()->rememberForever('totem.task.'.$value, function () use ($value) {
3030
return Task::find($value) ?? abort(404);
3131
});
3232
});

src/Providers/TotemServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function boot()
2929
return CronExpression::isValidExpression($value);
3030
});
3131

32-
Validator::extend('json_file', function($attribute,UploadedFile $value, $validator) {
32+
Validator::extend('json_file', function ($attribute, UploadedFile $value, $validator) {
3333
return $value->getClientOriginalExtension() == 'json';
3434
});
3535
}

0 commit comments

Comments
 (0)