SlevomatCodingStandard.Functions.StaticClosure
: provide setting to toggle for arrow functions or traditional closures
#1711
Labels
SlevomatCodingStandard.Functions.StaticClosure
does not provide a setting totoggle this sniff for only arrow functions or traditional
function
closuresyntax.
While declaring traditional closures static might be a best practice, the PHP
RFC introducing the arrow function implementation implies that declaring
static
arrow functions is a micro-optimization in the majority of cases:and:
https://wiki.php.net/rfc/arrow_functions_v2#this_binding_and_static_arrow_functions
Personally, I would prefer to avoid the addition of
static
for arrow functions,as it seems they are, by design, intended to provide a concise syntax without
static
. Since I don't particularly care aboutstatic
for traditional closures,I am fine with just removing this sniff from my configuration.
The text was updated successfully, but these errors were encountered: