Skip to content

Commit d1daa20

Browse files
Use a static function rather than a plain function.
This prevents us from defining the same anonymous function inside a loop (optimization).
1 parent 3207bf8 commit d1daa20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Objects/BaseObject.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function loadFromArray($object)
4343
public function jsonSerialize()
4444
{
4545
$properties = get_object_vars($this);
46-
$properties = array_filter($properties, function ($value) {
46+
$properties = array_filter($properties, static function ($value) {
4747
return $value === false || !empty($value);
4848
});
4949

0 commit comments

Comments
 (0)