-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[2.8][Form] Deprecate alias tag option #15926
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,11 +53,18 @@ public function process(ContainerBuilder $container) | |
$typeExtensions = array(); | ||
|
||
foreach ($container->findTaggedServiceIds('form.type_extension') as $serviceId => $tag) { | ||
$alias = isset($tag[0]['alias']) | ||
? $tag[0]['alias'] | ||
: $serviceId; | ||
$extendedType = null; | ||
if (isset($tag[0]['extended_type'])) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a fan of this renaming:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Option names are normalized: https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php#L240 I really don't like the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I forgot that. |
||
$extendedType = $tag[0]['extended_type']; | ||
} elseif (isset($tag[0]['alias'])) { | ||
@trigger_error('The alias option of the form.type_extension tag is deprecated since version 2.8 and will be removed in 3.0. Use the extended_type option instead.', E_USER_DEPRECATED); | ||
$extendedType = $tag[0]['alias']; | ||
} else { | ||
@trigger_error('The extended_type option of the form.type_extension tag is required since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); | ||
$extendedType = $serviceId; | ||
} | ||
|
||
$typeExtensions[$alias][] = $serviceId; | ||
$typeExtensions[$extendedType][] = $serviceId; | ||
} | ||
|
||
$definition->replaceArgument(2, $typeExtensions); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is useless, but it doesn't hurt that much and reduces the changes to be done in 3.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in 3.0 we will throw an exception, there is no default
null