Completed
Push — master ( 43d6b6...7fd3dc )
by Sherif
12:33
created

OauthClient::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace App\Modules\V1\Acl;
4
5
use Laravel\Passport\Client;
6
7
class OauthClient extends Client
8
{
9
    protected $dates    = ['created_at', 'updated_at'];
10
    protected $fillable = ['name', 'redirect', 'user_id', 'personal_access_client', 'password_client', 'revoked'];
11
    public $searchable  = ['name'];
12
    
13
    public function getCreatedAtAttribute($value)
14
    {
15
        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
16
    }
17
18
    public function getUpdatedAtAttribute($value)
19
    {
20
        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
21
    }
22
    
23
    public static function boot()
24
    {
25
        parent::boot();
26
        parent::observe(\App::make('App\Modules\V1\Acl\ModelObservers\OauthClientObserver'));
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (observe() instead of boot()). Are you sure this is correct? If so, you might want to change this to $this->observe().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
27
    }
28
}
29