@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | use \Exception as phpException; |
| 25 | 25 | |
| 26 | -if (! function_exists('array_get')) |
|
| 26 | +if (!function_exists('array_get')) |
|
| 27 | 27 | { |
| 28 | 28 | /* |
| 29 | 29 | * |
@@ -37,11 +37,11 @@ discard block |
||
| 37 | 37 | if (!is_array($data)) { |
| 38 | 38 | return $default; |
| 39 | 39 | } |
| 40 | - return isset($data[$key]) ? $data[$key]: $default; |
|
| 40 | + return isset($data[$key]) ? $data[$key] : $default; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | -if(!function_exists('array_keys_exist')){ |
|
| 44 | +if (!function_exists('array_keys_exist')) { |
|
| 45 | 45 | /** |
| 46 | 46 | * Checks if multiple keys exist in an array |
| 47 | 47 | * |
@@ -50,23 +50,23 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @return bool |
| 52 | 52 | */ |
| 53 | - function array_keys_exist( array $array, $keys ) { |
|
| 53 | + function array_keys_exist(array $array, $keys) { |
|
| 54 | 54 | $count = 0; |
| 55 | - if ( ! is_array( $keys ) ) { |
|
| 55 | + if (!is_array($keys)) { |
|
| 56 | 56 | $keys = func_get_args(); |
| 57 | - array_shift( $keys ); |
|
| 57 | + array_shift($keys); |
|
| 58 | 58 | } |
| 59 | - foreach ( $keys as $key ) { |
|
| 60 | - if ( array_key_exists( $key, $array ) ) { |
|
| 61 | - $count ++; |
|
| 59 | + foreach ($keys as $key) { |
|
| 60 | + if (array_key_exists($key, $array)) { |
|
| 61 | + $count++; |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - return count( $keys ) === $count; |
|
| 65 | + return count($keys) === $count; |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | -function checkHistory($period, $start, $end){ |
|
| 69 | +function checkHistory($period, $start, $end) { |
|
| 70 | 70 | //Validate Period |
| 71 | 71 | $valid_period_options = ["today", "week", "month", "30", "90", "year", "custom"]; |
| 72 | 72 | |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | 'period' => $period |
| 79 | 79 | ]; |
| 80 | 80 | |
| 81 | - if ($period == 'custom'){ |
|
| 82 | - if (!$start || !$end){ |
|
| 81 | + if ($period == 'custom') { |
|
| 82 | + if (!$start || !$end) { |
|
| 83 | 83 | throw new IsNull("Invalid custom Start or End date"); |
| 84 | 84 | } |
| 85 | 85 | $post_data['start'] = $start; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | return $post_data; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | -function cleanResponse($response){ |
|
| 91 | +function cleanResponse($response) { |
|
| 92 | 92 | $result = $response->getBody(); |
| 93 | 93 | return $result; |
| 94 | 94 | } |
| 95 | 95 | \ No newline at end of file |