Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 14 |
|
0.00% |
0 / 5 |
CRAP | n/a |
0 / 0 |
|
getPercentage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getNumberFomPercentage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getSiteName | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
getDateFormat | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
getTimeZone | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | use App\Models\Setting; |
4 | |
5 | function getPercentage($smallNum, $bigNum){ |
6 | return ($smallNum / $bigNum) * 100; |
7 | } |
8 | |
9 | function getNumberFomPercentage($bigNum, $percentage){ |
10 | return ($bigNum / 100) * $percentage; |
11 | } |
12 | |
13 | function getSiteName(){ |
14 | if(!session('site_name')){ |
15 | $setting = Setting::first(); |
16 | session(['site_name' => $setting->site_name]); |
17 | } |
18 | |
19 | return session('site_name'); |
20 | } |
21 | |
22 | function getDateFormat(){ |
23 | if(!session('date_format')){ |
24 | $setting = Setting::first(); |
25 | session(['date_format' => $setting->date_format]); |
26 | } |
27 | |
28 | return session('date_format'); |
29 | } |
30 | |
31 | function getTimeZone(){ |
32 | if(!session('time_zone')){ |
33 | $setting = Setting::first(); |
34 | session(['time_zone' => $setting->time_zone]); |
35 | } |
36 | |
37 | return session('time_zone'); |
38 | } |