Completed
Push — master ( 8c0974...426919 )
by Eric
05:34
created

TaskObserver::retrieved()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
eloc 0
nc 1
nop 1
1
<?php
2
3
namespace App\Observers;
4
5
use App\Task;
6
use App\TaskEvent;
7
use App\User;
8
use Carbon\Carbon;
9
10
class TaskObserver
11
{
12
    /**
13
     * Listen to the Task created event.
14
     *
15
     * @param  \App\Task  $task
16
     * @return void
17
     */
18
    public function created(Task $task)
19
    {
20
        TaskEvent::create([
21
            'time' => Carbon::now(),
22
            'task_name' => $task->name,
23
            'user_name' => User::findOrFail($task->user_id)->name,
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist on App\User. Since you implemented __get, consider adding a @property annotation.
Loading history...
24
        ]);
25
    }
26
27
    /**
28
     * Listen to the Task deleting event.
29
     *
30
     * @param  \App\Task  $task
31
     * @return void
32
     */
33
    public function deleted(Task $task)
0 ignored issues
show
Unused Code introduced by
The parameter $task is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

33
    public function deleted(/** @scrutinizer ignore-unused */ Task $task)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
    {
35
        //
36
    }
37
38
    public function retrieved(Task $task)
0 ignored issues
show
Unused Code introduced by
The parameter $task is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

38
    public function retrieved(/** @scrutinizer ignore-unused */ Task $task)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
    {
40
        //
41
    }
42
43
    public function updated(Task $task)
0 ignored issues
show
Unused Code introduced by
The parameter $task is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

43
    public function updated(/** @scrutinizer ignore-unused */ Task $task)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
44
    {
45
        //
46
    }
47
48
    public function saved(Task $task)
0 ignored issues
show
Unused Code introduced by
The parameter $task is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

48
    public function saved(/** @scrutinizer ignore-unused */ Task $task)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
49
    {
50
        //
51
    }
52
}