Issues (41)

app/Tasks.php (2 issues)

1
<?php
2
3
namespace TaskManager;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Tasks extends Model
8
{
9
    protected $fillable = [ 'task', 'complete','user_id'];
10
11
    public function user()
12
    {
13
       return $this->belongsTo('\TaskManager\User', 'user_id');
14
    }
15
    public function setCompleteAttribute($value){
16
        $this->attributes['complete'] = $value ?? false;
17
    }
18
    public function setUserIdAttribute($value){
0 ignored issues
show
The parameter $value 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

18
    public function setUserIdAttribute(/** @scrutinizer ignore-unused */ $value){

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...
19
        $this->attributes['user_id'] = auth()->id();
0 ignored issues
show
The method id() does not exist on Illuminate\Contracts\Auth\Factory. ( Ignorable by Annotation )

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

19
        $this->attributes['user_id'] = auth()->/** @scrutinizer ignore-call */ id();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
20
    }
21
}
22