Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
35 | protected function calculateOnDaysback($daysBack) |
||
36 | { |
||
37 | $allPayments = EcommercePayment::get() |
||
38 | ->where('"EcommercePayment"."LastEdited" > ( NOW() - INTERVAL '.($daysBack).' DAY )'); |
||
39 | $list = $allPayments->column('Status'); |
||
40 | $total = count($list); |
||
41 | $totals = []; |
||
42 | foreach($list as $status) { |
||
43 | if(!isset($totals[$status])) { |
||
44 | $totals[$status] = 0; |
||
45 | } |
||
46 | $totals[$status]++; |
||
47 | } |
||
48 | $data = [ |
||
49 | 'Total' => $total, |
||
50 | 'Totals' => $totals |
||
51 | ]; |
||
52 | |||
53 | return $data; |
||
54 | |||
55 | } |
||
56 | |||
76 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.