Skip to content

Commit d70226c

Browse files
carusogabrielroshangautam
authored andcommitted
refactor(php-doc) : add/edit phpdoc to every controller method
- Create PHPDocs for ActiveTasksController - Create PHPDocs for DashboardController - Create PHPDocs for ExecuteTasksController - Update PHPDocs in TasksController
1 parent 76c268f commit d70226c

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

src/Http/Controllers/ActiveTasksController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,25 @@ public function __construct(TaskInterface $tasks)
2222
$this->tasks = $tasks;
2323
}
2424

25+
/**
26+
* Store a newly active task in storage.
27+
*
28+
* @param \Illuminate\Http\Request $request
29+
* @return \Illuminate\Http\Response
30+
*/
2531
public function store(Request $request)
2632
{
2733
$task = $this->tasks->activate($request->all());
2834

2935
return response()->json($task, 200);
3036
}
3137

38+
/**
39+
* Remove the specified resource from storage.
40+
*
41+
* @param int $id
42+
* @return \Illuminate\Http\Response
43+
*/
3244
public function destroy($id)
3345
{
3446
$task = $this->tasks->deactivate($id);

src/Http/Controllers/DashboardController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
class DashboardController extends Controller
66
{
7+
/**
8+
* Single page application catch-all route.
9+
*
10+
* @return \Illuminate\Http\Response
11+
*/
712
public function index()
813
{
914
return redirect()->route('totem.tasks.all');

src/Http/Controllers/ExecuteTasksController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
class ExecuteTasksController extends Controller
88
{
9+
/**
10+
* Execute a specific task.
11+
*
12+
* @return \Illuminate\Http\Response
13+
*/
914
public function index($task)
1015
{
1116
$command = app($task->command);

src/Http/Controllers/TasksController.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class TasksController extends Controller
2222

2323
/**
2424
* TasksController constructor.
25+
*
2526
* @param TaskInterface $tasks
2627
* @param Kernel $kernel
2728
*/
@@ -34,6 +35,8 @@ public function __construct(TaskInterface $tasks, Kernel $kernel)
3435
}
3536

3637
/**
38+
* Display a listing of the tasks.
39+
*
3740
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
3841
*/
3942
public function index()
@@ -44,6 +47,8 @@ public function index()
4447
}
4548

4649
/**
50+
* Show the form for creating a new task.
51+
*
4752
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
4853
*/
4954
public function create()
@@ -57,6 +62,8 @@ public function create()
5762
}
5863

5964
/**
65+
* Store a newly created task in storage.
66+
*
6067
* @param TaskRequest $request
6168
* @return \Illuminate\Http\RedirectResponse
6269
*/
@@ -70,6 +77,8 @@ public function store(TaskRequest $request)
7077
}
7178

7279
/**
80+
* Display the specified task.
81+
*
7382
* @param $task
7483
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
7584
*/
@@ -81,6 +90,8 @@ public function view($task)
8190
}
8291

8392
/**
93+
* Show the form for editing the specified task.
94+
*
8495
* @param $task
8596
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
8697
*/
@@ -95,6 +106,8 @@ public function edit($task)
95106
}
96107

97108
/**
109+
* Update the specified task in storage.
110+
*
98111
* @param TaskRequest $request
99112
* @param $task
100113
* @return \Illuminate\Http\RedirectResponse
@@ -109,6 +122,8 @@ public function update(TaskRequest $request, $task)
109122
}
110123

111124
/**
125+
* Remove the specified task from storage.
126+
*
112127
* @param $task
113128
* @return \Illuminate\Http\RedirectResponse
114129
*/

0 commit comments

Comments
 (0)