Skip to content

Commit 2a034d6

Browse files
authored
Revert "[8.0] Keep casted attributes #1747"
1 parent a5d2cbc commit 2a034d6

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/Processors/DataProcessor.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,7 @@ protected function escapeColumns(array $output)
232232
} elseif (is_array($this->escapeColumns)) {
233233
$columns = array_diff($this->escapeColumns, $this->rawColumns);
234234
foreach ($columns as $key) {
235-
$data = array_get($row, $key);
236-
$dataType = gettype($data);
237-
$data = e($data);
238-
settype($data, $dataType);
239-
array_set($row, $key, $data);
235+
array_set($row, $key, e(array_get($row, $key)));
240236
}
241237
}
242238

@@ -255,9 +251,7 @@ protected function escapeRow(array $row)
255251
$arrayDot = array_filter(array_dot($row));
256252
foreach ($arrayDot as $key => $value) {
257253
if (! in_array($key, $this->rawColumns)) {
258-
$dataType = gettype($value);
259254
$arrayDot[$key] = e($value);
260-
settype($arrayDot[$key], $dataType);
261255
}
262256
}
263257

src/Utilities/Helper.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ public static function getOrMethod($method)
155155
*/
156156
public static function convertToArray($row)
157157
{
158-
$data = $row instanceof Arrayable ?
159-
$row->toArray() :
160-
($row instanceof \StdClass ? (array) $row : $row);
158+
$data = $row instanceof Arrayable ? $row->toArray() : (array) $row;
161159

162160
foreach ($data as &$value) {
163161
if (is_object($value) || is_array($value)) {

0 commit comments

Comments
 (0)