From bdfa67d1f6a8464c8bc3897f46540c982241de19 Mon Sep 17 00:00:00 2001 From: Mark Magyar <14284867+xHeaven@users.noreply.github.com> Date: Sat, 27 May 2023 20:42:40 +0200 Subject: [PATCH] use static keyword for anonymous function definition --- lib/Providers/Qr/BaconQrCodeProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Providers/Qr/BaconQrCodeProvider.php b/lib/Providers/Qr/BaconQrCodeProvider.php index 5ddbca6..089ad0b 100644 --- a/lib/Providers/Qr/BaconQrCodeProvider.php +++ b/lib/Providers/Qr/BaconQrCodeProvider.php @@ -106,7 +106,7 @@ class BaconQrCodeProvider implements IQRCodeProvider private function handleColour(array|string $colour): array|string { if (is_string($colour) && $colour[0] == '#') { - $hexToRGB = function ($input) { + $hexToRGB = static function ($input) { // ensure input no longer has a # for more predictable division // PHP 8.1 does not like implicitly casting a float to an int $input = trim($input, '#'); @@ -120,7 +120,7 @@ class BaconQrCodeProvider implements IQRCodeProvider // cope with three character hex reference if (strlen($input) == 3) { - array_walk($split, function (&$character) { + array_walk($split, static function (&$character) { $character = str_repeat($character, 2); }); }