Open slaFFik opened 7 months ago
Maybe it would be a good idea in cases like this:
<?php return ob_get_clean();
to not throw AddEmptyLineBeforeReturnStatement warning and allow it?
AddEmptyLineBeforeReturnStatement
When I have this code:
wpforms-phpcs screams at me with WPForms.Formatting.EmptyLineBeforeReturn.AddEmptyLineBeforeReturnStatement.
WPForms.Formatting.EmptyLineBeforeReturn.AddEmptyLineBeforeReturnStatement
The obvious fix in this case right now is having this:
But to my eye, that looks worse and actually hurts readability.
When parsing tags check whether the previous line has a PHP opening tag, and if not - allow it being there instead of the empty line.
Expected Behavior
Maybe it would be a good idea in cases like this:
to not throw
AddEmptyLineBeforeReturnStatement
warning and allow it?Current Behavior
When I have this code:
wpforms-phpcs screams at me with
WPForms.Formatting.EmptyLineBeforeReturn.AddEmptyLineBeforeReturnStatement
.The obvious fix in this case right now is having this:
But to my eye, that looks worse and actually hurts readability.
Possible Solution
When parsing tags check whether the previous line has a PHP opening tag, and if not - allow it being there instead of the empty line.