Completed
Push — master ( 27ed2b...a6fcc7 )
by Quim González
06:38
created

TaskObserver::updated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 2
rs 10
c 1
b 0
f 0
cc 1
eloc 0
nc 1
nop 1
1
<?php
2
3
use App\Task;
4
use App\TaskEvent;
5
use Carbon\Carbon;
6
7
/**
8
 * Created by PhpStorm.
9
 * User: quim
10
 * Date: 15/02/18
11
 * Time: 21:13
12
 */
13
14
class TaskObserver{
15
16
17
    /**
18
     * @param Task $task
19
     */
20
    public function created(Task $task)
21
    {
22
23
        TaskEvent::create([
24
25
            'time' => Carbon::now(),
26
            'type' => 'created',
27
            'task_name' => $task->name,
28
            'user_name' => $task->user->name,
0 ignored issues
show
Bug introduced by
The property user does not exist on App\Task. Did you mean user_id?
Loading history...
29
30
31
        ]);
32
33
34
35
    }
36
37
    /**
38
     * @param User $task
0 ignored issues
show
Bug introduced by
The type User was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
39
     */
40
    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

40
    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...
41
    {
42
43
    }
44
45
46
    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

46
    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...
47
    {
48
49
    }
50
}