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