GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( ea9462...f6a83c )
by Nikhil
10:26
created

Supplier   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 8
Bugs 1 Features 4
Metric Value
wmc 3
c 8
b 1
f 4
lcom 1
cbo 3
dl 0
loc 52
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 1
A makePurchase() 0 4 1
A purchases() 0 4 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent;
6
7
/**
8
 * App\Supplier
9
 *
10
 * @property integer $id
11
 * @property string $name
12
 * @property string $location
13
 * @property \Carbon\Carbon $deleted_at
14
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Purchase[] $purchases
15
 * @method static \Illuminate\Database\Query\Builder|\App\Supplier whereId($value)
16
 * @method static \Illuminate\Database\Query\Builder|\App\Supplier whereName($value)
17
 * @method static \Illuminate\Database\Query\Builder|\App\Supplier whereLocation($value)
18
 * @method static \Illuminate\Database\Query\Builder|\App\Supplier whereDeletedAt($value)
19
 * @mixin \Eloquent
20
 */
21
class Supplier extends Eloquent\Model
22
{
23
    use Eloquent\SoftDeletes;
24
25
    /**
26
     * We do not want any timestamps.
27
     *
28
     * @var bool
29
     */
30
    public $timestamps = false;
31
    /**
32
     * @var array
33
     */
34
    protected $dates = ['deleted_at'];
35
    /**
36
     * The attributes that are mass assignable.
37
     *
38
     * @var array
39
     */
40
    protected $fillable = ['name', 'location'];
41
42 11
    public static function boot()
43
    {
44 11
        parent::boot();
45
46 11
        static::deleting(function (Supplier $supplier) {
47
            $supplier->purchases()->delete();
48 11
        });
49 11
    }
50
51
    /**
52
     * Make a purchase.
53
     *
54
     * @param array $attributes
55
     *
56
     * @return Purchase
57
     */
58 1
    public function makePurchase(array $attributes)
59
    {
60 1
        return $this->purchases()->create($attributes);
61
    }
62
63
    /**
64
     * Purchases from this supplier.
65
     *
66
     * @return Eloquent\Relations\HasMany
67
     */
68 1
    public function purchases()
69
    {
70 1
        return $this->hasMany(Purchase::class);
71
    }
72
}
73