Skip to content

Commit

Permalink
white space
Browse files Browse the repository at this point in the history
  • Loading branch information
rudiedirkx committed Mar 10, 2023
1 parent e65c364 commit a28f76b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*.php]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
30 changes: 15 additions & 15 deletions src/Kris/LaravelFormBuilder/Fields/CollectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,22 +202,22 @@ protected function formatInputIntoModels(array $input, array $originalData = [])

protected function formatInputIntoModel($model, $input)
{
if ($model instanceof Model) {
$model->forceFill($input);
}
elseif (is_object($model)) {
foreach ($input as $key => $value) {
$model->$key = $value;
if ($model instanceof Model) {
$model->forceFill($input);
}
}
elseif (is_array($model)) {
$model = $input + $model;
}
else {
$model = $input;
}

return $model;
elseif (is_object($model)) {
foreach ($input as $key => $value) {
$model->$key = $value;
}
}
elseif (is_array($model)) {
$model = $input + $model;
}
else {
$model = $input;
}

return $model;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Kris/LaravelFormBuilder/RulesParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected function min($param)
}

if ($this->isFile()) {
return [];
return [];
}

return [
Expand Down Expand Up @@ -303,7 +303,7 @@ protected function max($param)
}

if ($this->isFile()) {
return [];
return [];
}

return ['maxlength' => $max];
Expand Down Expand Up @@ -333,7 +333,7 @@ protected function between($param)
}

if ($this->isFile()) {
return [];
return [];
}

return [
Expand Down

0 comments on commit a28f76b

Please sign in to comment.