Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
esokullu authored Jan 30, 2018
1 parent ec5c4ec commit e27c83e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Pho/Framework/AbstractEdge.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,19 @@ protected function fill(array $args): AbstractEdge

public function __call(string $method, array $args)//: mixed
{
$field_setter = function(string $field, array $args): void
$all_fields = $this->fields;
$attributes = $this->attributes();
$field_setter = function(string $field, array $args) use ($all_fields, $attributes): void
{
$value = $args[0];
$is_quiet = (count($args) >= 2 && $args[1] == true);
$field_helper = new FieldHelper($value, $this->fields[$field]);
$field_helper = new FieldHelper($value, $all_fields[$field]);
$field_helper->probe(); // make sure this fits.
if($is_quiet) {
$this->attributes()->quietSet($field, $field_helper->process($value));
$attributes->quietSet($field, $field_helper->process($value));
return;
}
$this->attributes()->$field = $field_helper->process($value);
$attributes->$field = $field_helper->process($value);
};

if(strlen($method)>4) {
Expand Down

0 comments on commit e27c83e

Please sign in to comment.