Skip to content

Commit 1760838

Browse files
committed
minor #16568 [Form] Enhance some FormRegistry deprecation messages (nicolas-grekas)
This PR was merged into the 2.8 branch. Discussion ---------- [Form] Enhance some FormRegistry deprecation messages | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 02d2148 [Form] Enhance some FormRegistry deprecation messages
2 parents cfc1e3a + 02d2148 commit 1760838

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function process(ContainerBuilder $container)
6767
@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);
6868
$extendedType = $tag[0]['alias'];
6969
} else {
70-
@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);
70+
@trigger_error('The extended_type option of the form.type_extension tag is required since version 2.8.', E_USER_DEPRECATED);
7171
$extendedType = $serviceId;
7272
}
7373

src/Symfony/Component/Form/FormRegistry.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,19 @@ private function resolveAndAddType(FormTypeInterface $type)
120120
$hasCustomName = $name !== $fqcn;
121121

122122
if ($parentType instanceof FormTypeInterface) {
123-
@trigger_error('Returning a FormTypeInterface from FormTypeInterface::getParent() is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
123+
@trigger_error(sprintf('Returning a FormTypeInterface from %s::getParent() is deprecated since version 2.8 and will be removed in 3.0. Return the fully-qualified type class name instead.', $fqcn), E_USER_DEPRECATED);
124124

125125
$this->resolveAndAddType($parentType);
126126
$parentType = $parentType->getName();
127127
}
128128

129129
if ($hasCustomName) {
130130
foreach ($this->extensions as $extension) {
131-
$typeExtensions = array_merge(
132-
$typeExtensions,
133-
$extension->getTypeExtensions($name)
134-
);
135-
}
131+
if ($x = $extension->getTypeExtensions($name)) {
132+
@trigger_error(sprintf('Returning a type name from %s::getExtendedType() is deprecated since version 2.8 and will be removed in 3.0. Return the fully-qualified type class name instead.', get_class($x[0])), E_USER_DEPRECATED);
136133

137-
if ($typeExtensions) {
138-
@trigger_error('Returning a type name from FormTypeExtensionInterface::getExtendedType() is deprecated since version 2.8 and will be removed in 3.0. Return the fully-qualified type class name instead.', E_USER_DEPRECATED);
134+
$typeExtensions = array_merge($typeExtensions, $x);
135+
}
139136
}
140137
}
141138

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy