Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | protected function calculateOnDaysback($daysBack) |
||
35 | { |
||
36 | $allPayments = EcommercePayment::get() |
||
37 | ->where('"EcommercePayment"."LastEdited" > ( NOW() - INTERVAL '.($daysBack).' DAY )'); |
||
38 | $list = $allPayments->column('Status'); |
||
39 | $total = count($list); |
||
40 | $totals = []; |
||
41 | foreach ($list as $status) { |
||
42 | if (!isset($totals[$status])) { |
||
43 | $totals[$status] = 0; |
||
44 | } |
||
45 | $totals[$status]++; |
||
46 | } |
||
47 | $data = [ |
||
48 | 'Total' => $total, |
||
49 | 'Totals' => $totals |
||
50 | ]; |
||
51 | |||
52 | return $data; |
||
53 | } |
||
54 | |||
73 |
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.