minor #66050 [FrameworkBundle][SecurityBundle] Remove inert "extended-type" tag attributes (nicolas-grekas)
This PR was merged into the 8.2 branch. Discussion ---------- [FrameworkBundle][SecurityBundle] Remove inert "extended-type" tag attributes | Q | A | ------------- | --- | Branch? | 8.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT `FormPass` reads the `form.type_extension` tag attribute as `extended_type`, with an underscore: https://github.com/symfony/symfony/blob/8.2/src/Symfony/Component/Form/DependencyInjection/FormPass.php#L110 Five PHP configs spell it `extended-type`, with a hyphen. `findTaggedServiceIds()` does no hyphen normalization, so those five attributes declare nothing and every one of those services already falls through to the `getExtendedTypes()` branch. The hyphenated spelling is the XML one, where it was valid and documented alongside the underscore form since 2.8. It was carried over mechanically when the XML configs were converted to PHP, and there is no XML loader left on this branch. Most type extensions in the same two files already tag without any attribute and rely on `getExtendedTypes()`, so this aligns the remaining five with them rather than correcting the spelling. Correcting it instead would buy nothing measurable: the only difference is skipping `getReflectionClass()` for five classes at compile time, while `DependencyInjectionExtension::getTypeExtensions()` calls `getExtendedTypes()` on every resolved type at runtime either way. The `extended_type` attribute itself stays supported. It is documented, covered by `FormPassTest`, and lets applications avoid loading an extension class at build time. Verified that the resolved extension map is identical before and after, by running `FormPass` over the five real extension classes with and without the attribute: ``` FormType => form.type_extension.form.transformation_failure_handling, form.type_extension.form.validator PasswordType => form.type_extension.password.password_hasher SubmitType => form.type_extension.submit.validator TextType => form.type_extension.form.html_sanitizer ``` Three imports become unused and are dropped with them. Commits ------- fbae4651a73 [FrameworkBundle][SecurityBundle] Remove inert "extended-type" tag attributes
N
Nicolas Grekas committed
55770d2eaf9eaa23146e83cb35530573afaaf00a