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
DX: Reduce usage of PhpCsFixer\DocBlock\Line::__toString #4098
DX: Reduce usage of PhpCsFixer\DocBlock\Line::__toString #4098
Conversation
src/DocBlock/Line.php
Outdated
@@ -42,6 +42,8 @@ public function __construct($content) | |||
* Get the string representation of object. | |||
* | |||
* @return string | |||
* | |||
* @deprecated will be removed in 3.0, use getContent |
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.
Shouldn't the method make a @trigger_error('...', E_USER_DEPRECATION)
call?
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.
risky, because a lot of IDE's call this method to show preview data when debugging
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.
Wouldn't @
make it transparent for IDEs?
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, provide reasoning why to deprecate this in first place.
Anyway, the magic is heavily used - in implode('', $lines); with: implode(
'',
array_map(
function (Line $line) {
return $line->getContent();
},
$lines
)
); ? |
@keradus not sure not now, initially was to simply avoid magic method. |
|
Already applied in #4088 |
note: If you want to get rid of them, please deprecate them (with real deprecation notice) everywhere, in all |
I would like to note that using Magic methods like I'm fine with not merging though as it might not be worth adding this BC break now :) |
I forget to close it, I've checked and it would not be that easy to remove the magic methods. |
just saying that change for a change is not a reason, it has to have background as said later, i'm not negative for such change, but it has to be applied fully |
No description provided.