Total Complexity | 4 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class AssociatedAsset extends MorphPivot |
||
9 | { |
||
10 | public $guarded = []; |
||
11 | protected $casts = [ |
||
12 | 'data' => 'array', |
||
13 | ]; |
||
14 | |||
15 | public function hasData(string $key): bool |
||
16 | { |
||
17 | return Arr::has($this->data, $key); |
||
18 | } |
||
19 | |||
20 | public function getData(string $key, $default = null) |
||
23 | } |
||
24 | |||
25 | public function setData(string $name, $value): self |
||
26 | { |
||
27 | $data = $this->data; |
||
28 | |||
29 | Arr::set($data, $name, $value); |
||
30 | |||
31 | $this->data = $data; |
||
|
|||
32 | |||
33 | return $this; |
||
34 | } |
||
35 | |||
36 | public function forgetData(string $name): self |
||
45 | } |
||
46 | } |
||
47 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.