Skip to content

Commit

Permalink
Option 'class' is allowed again
Browse files Browse the repository at this point in the history
Partially reverts commit 046f89c.
  • Loading branch information
dg committed Sep 29, 2023
1 parent cd50d0e commit 7912153
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/DI/Extensions/DefinitionSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ public function normalize($def, Context $context)
if (
isset($def['class'])
&& !isset($def['type'])
&& !isset($def['create'])
&& !isset($def['dynamic'])
&& !isset($def['imported'])
) {
$def['create'] = $def['class'];
$def[isset($def['create']) ? 'type' : 'create'] = $def['class'];
unset($def['class']);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/DI/files/compiler.services.create.neon
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
factory: %class%(1)

three:
type: Lorem
class: Lorem
factory: Factory::createLorem
arguments: [1, 2]

Expand Down

0 comments on commit 7912153

Please sign in to comment.