Empty FUNCTION statement detected should be allowed for around plugins #95
Labels
accepted
New rule is accepted
enhancement
Improvements to existing rules
false positive
Rule causes false positive findings
Progress: good first issue
Issues is easy to get started with
Description
A WARNING is thrown for sniff "Empty FUNCTION statement detected"
This warning should not be through if the empty function is an
around
plugin. A common use-case for around plugins is to prevent execution of the original calling method. For example:Expected behavior
I would expect this sniff to still run and throw a WARNING in all circumstances other than an
around
plugin. The sniff should not throw a WARNING for anaround
plugin.A consideration may be to mandate the use of a comment for an
around
plugin with an empty function statement. This would ensure that the emptyaround
plugin not calling the callable$proceed
is desired. See above for an example comment which explains why thisaround
plugin is empty.Benefits
Empty
around
plugins are not only valid but this is a common use-case. The sniff should not detect this as an error. A comment within an emptyaround
plugin would also most likely be desired and document to the user why thisaround
function is empty.The text was updated successfully, but these errors were encountered: