Conditions | 9 |
Paths | 8 |
Total Lines | 43 |
Code Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function storeEditAllItems(Request $request, string $event, array $options) |
||
|
|||
20 | { |
||
21 | //Get the item name |
||
22 | $items = $this->getItems(); |
||
23 | |||
24 | //Current Obj Create |
||
25 | foreach ($items as $key => $item) { |
||
26 | $is_ML = isML($item); |
||
27 | $is_MD = isMD($item); |
||
28 | |||
29 | $is_fillable = isFillable($item, $event); |
||
30 | $is_skippable = $this->getIsSkippable($request->has($key)); |
||
31 | |||
32 | if ($is_skippable) { |
||
33 | continue; |
||
34 | } else { |
||
35 | $this->checkRequestExistence( |
||
36 | $request, |
||
37 | $key |
||
38 | ); |
||
39 | } |
||
40 | |||
41 | if ($is_fillable) { |
||
42 | if ($is_ML) { |
||
43 | if (is_null($this->$key)) { |
||
44 | $old_value = []; |
||
45 | } else { |
||
46 | $old_value = $this->$key; |
||
47 | } |
||
48 | $this->$key = ml($old_value, $request->input($key)); |
||
49 | } elseif ($is_MD) { |
||
50 | if ($request->input($key) == '' || $request->input($key) == null) { |
||
51 | $this->$key = null; |
||
52 | } else { |
||
53 | $this->$key = new UTCDateTime(new DateTime($request->input($key))); |
||
54 | } |
||
55 | } else { |
||
56 | $this->$key = $request->input($key); |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 | |||
61 | $this->save(); |
||
62 | } |
||
64 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.