Model   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRawAttribute() 0 4 1
A boot() 0 5 1
1
<?php
2
3
namespace Tracking\Models;
4
5
use Illuminate\Database\Eloquent\Model as EloquentModel;
6
use Illuminate\Database\Eloquent\Builder;
7
use Illuminate\Support\Facades\Hash;
8
use Auth;
9
10
class Model extends EloquentModel
11
{
12
    /**
13
     * Provides public access to get the raw attribute value from the model.
14
     * Used in areas where no mutations are required but performance is critical.
15
     *
16
     * @param  $key
17
     * @return mixed
18
     */
19
    public function getRawAttribute($key)
20
    {
21
        return parent::getAttributeFromArray($key);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getAttributeFromArray() instead of getRawAttribute()). Are you sure this is correct? If so, you might want to change this to $this->getAttributeFromArray().

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...
22
    }
23
24
    public static function boot()
25
    {
26
        parent::boot();
27
28
    }
29
}