File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 2222
2323trait HasCases
2424{
25- protected $ case = self ::NO_CASE ;
25+ protected int $ case = self ::NO_CASE ;
2626
2727 /**
2828 * @param int $type
Original file line number Diff line number Diff line change 1717
1818namespace DragonCode \PrettyArray \Concerns ;
1919
20+ use DragonCode \Support \Facades \Helpers \Boolean ;
21+
2022trait HasCastable
2123{
2224 /**
2325 * Castable value.
2426 *
25- * @param mixed $value
27+ * @param mixed|null $value
2628 *
27- * @return mixed
29+ * @return string|int|float
2830 */
29- protected function castValue ($ value = null )
31+ protected function castValue (mixed $ value = null ): string | int | float
3032 {
3133 if (is_numeric ($ value )) {
3234 return $ value ;
3335 }
3436
3537 if (is_bool ($ value )) {
36- return $ value ? ' true ' : ' false ' ;
38+ return Boolean:: toString ( $ value) ;
3739 }
3840
3941 if (is_null ($ value )) {
You can’t perform that action at this time.
0 commit comments