Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[8.0] Keep casted attributes #1747" #1952

Merged
merged 1 commit into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/Processors/DataProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
}

Expand All @@ -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);
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/Utilities/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down