| 1 | <?php namespace Darryldecode\Cart\Helpers; |
||
| 10 | class Helpers { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * normalize price |
||
| 14 | * |
||
| 15 | * @param $price |
||
| 16 | * @return float |
||
| 17 | */ |
||
| 18 | public static function normalizePrice($price) |
||
| 22 | |||
| 23 | /** |
||
| 24 | * check if array is multi dimensional array |
||
| 25 | * This will only check the first element of the array if it is still an array |
||
| 26 | * to decide that it is a multi dimensional, if you want to check the array strictly |
||
| 27 | * with all on its element, flag the second argument as true |
||
| 28 | * |
||
| 29 | * @param $array |
||
| 30 | * @param bool $recursive |
||
| 31 | * @return bool |
||
| 32 | */ |
||
| 33 | public static function isMultiArray($array, $recursive = false) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * check if variable is set and has value, return a default value |
||
| 58 | * |
||
| 59 | * @param $var |
||
| 60 | * @param bool|mixed $default |
||
| 61 | * @return bool|mixed |
||
| 62 | */ |
||
| 63 | public static function issetAndHasValueOrAssignDefault(&$var, $default = false) |
||
| 69 | |||
| 70 | public static function formatValue($value, $format_numbers, $config) |
||
| 78 | } |