| Total Complexity | 8 |
| Total Lines | 92 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | trait Objects |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * check if give value is array or not |
||
| 9 | * |
||
| 10 | * @param null $value |
||
|
|
|||
| 11 | * |
||
| 12 | * @return bool |
||
| 13 | * |
||
| 14 | */ |
||
| 15 | 11 | public static function isArray($value = null) |
|
| 16 | { |
||
| 17 | 11 | return \is_array($value); |
|
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * check if give value is function or not |
||
| 22 | * |
||
| 23 | * @param null $value |
||
| 24 | * |
||
| 25 | * @return bool |
||
| 26 | * |
||
| 27 | */ |
||
| 28 | 1 | public static function isFunction($value = null) |
|
| 29 | { |
||
| 30 | 1 | return \is_callable($value); |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * check if give value is null or not |
||
| 35 | * |
||
| 36 | * @param null $value |
||
| 37 | * |
||
| 38 | * @return bool |
||
| 39 | * |
||
| 40 | */ |
||
| 41 | 16 | public static function isNull($value = null) |
|
| 42 | { |
||
| 43 | 16 | return \is_null($value); |
|
| 44 | } |
||
| 45 | |||
| 46 | |||
| 47 | /** |
||
| 48 | * check if give value is number or not |
||
| 49 | * |
||
| 50 | * @param null $value |
||
| 51 | * |
||
| 52 | * @return bool |
||
| 53 | * |
||
| 54 | */ |
||
| 55 | 1 | public static function isNumber($value = null) |
|
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * check if give value is object or not |
||
| 62 | * |
||
| 63 | * @param null $value |
||
| 64 | * |
||
| 65 | * @return bool |
||
| 66 | * |
||
| 67 | */ |
||
| 68 | 21 | public static function isObject($value = null) |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * check if give value is string or not |
||
| 75 | * |
||
| 76 | * @param null $value |
||
| 77 | * |
||
| 78 | * @return bool |
||
| 79 | * |
||
| 80 | */ |
||
| 81 | 1 | public static function isString($value = null) |
|
| 84 | } |
||
| 85 | |||
| 86 | /** |
||
| 87 | * Check if the object is a collection. |
||
| 88 | * A collection is either an array or an object. |
||
| 89 | * |
||
| 90 | * @param null $object |
||
| 91 | * |
||
| 92 | * @return bool |
||
| 93 | */ |
||
| 94 | 4 | public static function isCollection($object) |
|
| 97 | } |
||
| 98 | } |