Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jun 6, 2020
1 parent 9655da2 commit fc78823
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,7 @@ protected function _factory($seed, $defaults = []): object
}

if ($injection) {
if (isset($object->_DIContainerTrait)) {
$object->setDefaults($injection);
} else {
throw (new Exception('factory() could not inject properties into new object. It does not use \atk4\core\DIContainerTrait'))
->addMoreInfo('object', $object)
->addMoreInfo('seed', $seed)
->addMoreInfo('injection', $injection);
}
$this->_mergeSeeds($injection, $object);
}

return $object;
Expand Down

0 comments on commit fc78823

Please sign in to comment.