diff --git a/src/Processors/DataProcessor.php b/src/Processors/DataProcessor.php index 7a4bf0c2..409a1de4 100644 --- a/src/Processors/DataProcessor.php +++ b/src/Processors/DataProcessor.php @@ -232,11 +232,7 @@ protected function escapeColumns(array $output) } elseif (is_array($this->escapeColumns)) { $columns = array_diff($this->escapeColumns, $this->rawColumns); foreach ($columns as $key) { - $data = array_get($row, $key); - $dataType = gettype($data); - $data = e($data); - settype($data, $dataType); - array_set($row, $key, $data); + array_set($row, $key, e(array_get($row, $key))); } } @@ -255,9 +251,7 @@ protected function escapeRow(array $row) $arrayDot = array_filter(array_dot($row)); foreach ($arrayDot as $key => $value) { if (! in_array($key, $this->rawColumns)) { - $dataType = gettype($value); $arrayDot[$key] = e($value); - settype($arrayDot[$key], $dataType); } } diff --git a/src/Utilities/Helper.php b/src/Utilities/Helper.php index 40aab03c..deda9521 100644 --- a/src/Utilities/Helper.php +++ b/src/Utilities/Helper.php @@ -155,9 +155,7 @@ public static function getOrMethod($method) */ public static function convertToArray($row) { - $data = $row instanceof Arrayable ? - $row->toArray() : - ($row instanceof \StdClass ? (array) $row : $row); + $data = $row instanceof Arrayable ? $row->toArray() : (array) $row; foreach ($data as &$value) { if (is_object($value) || is_array($value)) {