-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] fix FormExtension::$renderer bc break #20710
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
Before b515702, the FormExtension::$renderer property was not declared but initialized in FormExtension::__construct(). This makes the property visibility to public. In b515702, the property was declared but with a private visibility. This broke the backward compatibility of the FormExtension class.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,10 @@ | |
*/ | ||
class FormExtension extends \Twig_Extension implements \Twig_Extension_InitRuntimeInterface | ||
{ | ||
private $renderer; | ||
/** | ||
* Make this property private in 4.0. | ||
*/ | ||
public $renderer; | ||
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. Maybe a better way might be to keep it private and use a magic getter to throw a deprecation notice? I know, magic is bad, but deprecation notices might outweight this? 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 like the idea but how to avoid access to properties other than 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'd indeed throw an exception. And yeah, |
||
|
||
public function __construct(TwigRendererInterface $renderer = null) | ||
{ | ||
|
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.
please mark it as
@internal
though, so that IDEs warn usersThere 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.
btw, no need to mark it as private in 4.0, as it will be removed.