public static function arrayToObjectRecursive($array)
    {
        $json = json_encode($array);
        if (json_last_error() !== \JSON_ERROR_NONE) {
            $message = 'Unable to encode schema array as JSON';
            if (function_exists('json_last_error_msg')) {
                $message .= ': ' . json_last_error_msg();
            }
            throw new InvalidArgumentException($message);
        }

        return (object) json_decode($json);
    }
public static function arrayToObjectRecursive($array)
    {
        $json = json_encode($array);
        if (json_last_error() !== \JSON_ERROR_NONE) {
            $message = 'Unable to encode schema array as JSON';
            if (function_exists('json_last_error_msg')) {
                $message .= ': ' . json_last_error_msg();
            }
            throw new InvalidArgumentException($message);
        }

        return (object) json_decode($json);
    }
public static function arrayToObjectRecursive ( $ array ) { $ json = json_encode ( $ array ) ; if ( json_last_error ( ) !== \ JSON_ERROR_NONE ) { $ message = 'Unable to encode schema array as JSON' ; if ( function_exists ( 'json_last_error_msg' ) ) { $ message .= ': ' . json_last_error_msg ( ) ; } throw new InvalidArgumentException ( $ message ) ; } return ( object ) json_decode ( $ json ) ; }
Recursively cast an associative array to an object

@param array $array

@return object
Recursively cast an associative array to an object