Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 807d192

Browse filesBrowse files
committed
minor #14905 [DX][Form] Show the class name when the deprecated setDefaultOptions is used (peterrehm)
This PR was merged into the 2.7 branch. Discussion ---------- [DX][Form] Show the class name when the deprecated setDefaultOptions is used | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - After upgrading to 2.7 I got plenty of deprecation messages which I could not assign directly as I have updated all of my FormTypes. ![bildschirmfoto 2015-06-07 um 12 02 22](https://cloud.githubusercontent.com/assets/2010989/8024784/8108aeee-0d0d-11e5-8f24-415c553ccb4c.png) Whit this minor improvement the actual class will be show so the upgrade will be much easier. ![bildschirmfoto 2015-06-07 um 12 01 24](https://cloud.githubusercontent.com/assets/2010989/8024788/93ff37d4-0d0d-11e5-8689-c3e8a933102b.png) I think same should be considered in other deprecation errors as it gets more difficult to trace down if external libraries are involved. Commits ------- a276eb0 Show the FormType and FormTypeExtension in case of deprecated use of setDefaultOptions
2 parents 53d9003 + a276eb0 commit 807d192
Copy full SHA for 807d192

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎src/Symfony/Component/Form/ResolvedFormType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ResolvedFormType.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function getOptionsResolver()
212212
$isNewOverwritten = $reflector->getDeclaringClass()->getName() !== 'Symfony\Component\Form\AbstractType';
213213

214214
if ($isOldOverwritten && !$isNewOverwritten) {
215-
trigger_error('The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0.', E_USER_DEPRECATED);
215+
trigger_error(get_class($this->innerType).': The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0.', E_USER_DEPRECATED);
216216
}
217217

218218
foreach ($this->typeExtensions as $extension) {
@@ -225,7 +225,7 @@ public function getOptionsResolver()
225225
$isNewOverwritten = $reflector->getDeclaringClass()->getName() !== 'Symfony\Component\Form\AbstractTypeExtension';
226226

227227
if ($isOldOverwritten && !$isNewOverwritten) {
228-
trigger_error('The FormTypeExtensionInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeExtensionInterface with Symfony 3.0.', E_USER_DEPRECATED);
228+
trigger_error(get_class($extension).': The FormTypeExtensionInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeExtensionInterface with Symfony 3.0.', E_USER_DEPRECATED);
229229
}
230230
}
231231
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.