Completed
Pull Request — master (#1)
by Tyler
07:02 queued 05:14
created

Pivot::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Tylercd100\Database\Eloquent\Relations;
4
5
use Illuminate\Database\Eloquent\Relations\Pivot as IlluminatePivot;
6
use Tylercd100\Database\Eloquent\Traits\AutoCache;
7
use Tylercd100\Database\Eloquent\Traits\AutoValidate;
8
9
abstract class Pivot extends IlluminatePivot
10
{
11
    use AutoCache {
12
        boot as bootAutoCache;
13
    }
14
15
    use AutoValidate {
16
        boot as bootAutoValidate;
17
    }
18
19
    /**
20
     * A method best used to register Eloquent events when the model boots up
21
     * @return void
22
     */
23
    protected static function boot()
24
    {
25
        parent::boot();
26
        self::bootAutoValidate();
27
        self::bootAutoCache();
28
    }
29
}
30