Skip to content

Commit 948403f

Browse files
committed
Ruleset: allow for return statement in otherwise empty function
Mostly used in abstract classes containing methods which are optional to overload.
1 parent 2e6132b commit 948403f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

PHPCSDev/ruleset.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@
210210
</rule>
211211

212212
<!-- Clean up: remove redundant code. -->
213-
<rule ref="Squiz.PHP.NonExecutableCode"/>
213+
<rule ref="Squiz.PHP.NonExecutableCode">
214+
<!-- Allow for return statement in otherwise empty function. -->
215+
<exclude name="Squiz.PHP.NonExecutableCode.ReturnNotRequired"/>
216+
</rule>
214217

215218
<!-- Clean up: no empty statements. -->
216219
<rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/>

0 commit comments

Comments
 (0)