]> _ Git - cubist_util.git/commitdiff
wip #4697 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Sep 2021 10:06:25 +0000 (12:06 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Sep 2021 10:06:25 +0000 (12:06 +0200)
src/ArrayUtil.php
src/ObjectUtil.php

index aef58b463d7f19a3ea7c94c4e23eecb323b8a193..7a602a48c9324dae153365b405197dc92296273c 100644 (file)
@@ -121,6 +121,10 @@ class ArrayUtil {
                }
        }
 
+    /**
+     * @param $input
+     * @return array
+     */
        public static function asArray($input) {
                if (is_array($input)) {
                        return $input;
@@ -128,7 +132,7 @@ class ArrayUtil {
                if (is_object($input)) {
                        return ObjectUtil::toArray($input);
                }
-               return array($input);
+               return [$input];
        }
 
        public static function array_key_exists_recursive($needle, $haystack) {
index cbc196bf417b0fdeb6533bab44ec31dca461d3da..941d2ec7d9ff2aa0ac82559973dd1a3da455d01d 100644 (file)
@@ -5,6 +5,10 @@ class ObjectUtil {
        protected $_orderOnProperty = null;
        protected $_orderOnIsMethod = false;
 
+    /**
+     * @param $o
+     * @return array
+     */
        public static function toArray($o) {
                if (is_array($o)) {
                        return $o;