Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccb04ad

Browse files
committed
minor #12654 [Hackday] [Form] Added deprecation notice on Form::getErrorsAsString (stefanosala)
This PR was merged into the 2.7 branch. Discussion ---------- [Hackday] [Form] Added deprecation notice on Form::getErrorsAsString | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12611 | License | MIT | Doc PR | - Commits ------- 1d45650 [Form] Added deprecation notice on Form::getErrorsAsString
2 parents 4e6b74b + 1d45650 commit ccb04ad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/Form/Form.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,8 @@ public function getErrors($deep = false, $flatten = true)
823823
*/
824824
public function getErrorsAsString($level = 0)
825825
{
826+
trigger_error('Form::getErrorsAsString() is deprecated since 2.5 and will be removed in 3.0. Please use Form::getErrors(true, false) instead and cast the result to a string.', E_USER_DEPRECATED);
827+
826828
return self::indent((string) $this->getErrors(true, false), $level);
827829
}
828830

0 commit comments

Comments
 (0)