From 9295f2d0268a0b04f42b55991c126e7be94e10a6 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Thu, 23 Feb 2023 23:50:09 -0800 Subject: [PATCH] general: use byval for array_map --- lib/Command/PlacesSetup.php | 4 ++-- lib/Controller/PlacesController.php | 2 +- lib/Controller/TagsController.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Command/PlacesSetup.php b/lib/Command/PlacesSetup.php index 7609aaf5..5fbebce9 100644 --- a/lib/Command/PlacesSetup.php +++ b/lib/Command/PlacesSetup.php @@ -228,7 +228,7 @@ class PlacesSetup extends Command } if (GIS_TYPE_MYSQL === $this->gisType) { - $points = implode(',', array_map(function (&$point) { + $points = implode(',', array_map(function ($point) { $x = $point[0]; $y = $point[1]; @@ -237,7 +237,7 @@ class PlacesSetup extends Command $geometry = "POLYGON(({$points}))"; } elseif (GIS_TYPE_POSTGRES === $this->gisType) { - $geometry = implode(',', array_map(function (&$point) { + $geometry = implode(',', array_map(function ($point) { $x = $point[0]; $y = $point[1]; diff --git a/lib/Controller/PlacesController.php b/lib/Controller/PlacesController.php index 4d93c89b..46174f0f 100644 --- a/lib/Controller/PlacesController.php +++ b/lib/Controller/PlacesController.php @@ -90,7 +90,7 @@ class PlacesController extends ApiBase shuffle($list); // Get preview from image list - return $this->getPreviewFromImageList(array_map(static function (&$item) { + return $this->getPreviewFromImageList(array_map(function ($item) { return (int) $item['fileid']; }, $list)); } diff --git a/lib/Controller/TagsController.php b/lib/Controller/TagsController.php index 8e369492..b6383d24 100644 --- a/lib/Controller/TagsController.php +++ b/lib/Controller/TagsController.php @@ -92,7 +92,7 @@ class TagsController extends ApiBase shuffle($list); // Get preview from image list - return $this->getPreviewFromImageList(array_map(static function (&$item) { + return $this->getPreviewFromImageList(array_map(function ($item) { return (int) $item['fileid']; }, $list)); }