Bug Description
There closures being used in the codebase which do not use $this. Granted, in most cases clases aren't even involved, but in those that are, using static is better for memory usage since the $this reference can be garbage collected. See SO answer.
I suggest that we do the following:
- Add
static to all closures that don't use $this.
- Incorporate the
SlevomatCodingStandard.Functions.StaticClosure sniff to catch this automatically.
Bug Description
There closures being used in the codebase which do not use
$this. Granted, in most cases clases aren't even involved, but in those that are, usingstaticis better for memory usage since the$thisreference can be garbage collected. See SO answer.I suggest that we do the following:
staticto all closures that don't use$this.SlevomatCodingStandard.Functions.StaticClosuresniff to catch this automatically.