fix action php version and handleColour function signature for bacon qr

This commit is contained in:
Nicolas CARPi
2022-12-09 19:32:27 +01:00
parent 25f463d19b
commit 1e75674a45
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
php-version: ['8.0', '8.1']
php-version: ['8.1']
endroid-version: ["^4"]
steps:
+2 -2
View File
@@ -110,9 +110,9 @@ class BaconQrCodeProvider implements IQRCodeProvider
* Ensure colour is an array of three values but also
* accept a string and assume its a 3 or 6 character hex
*/
private function handleColour(string $colour): string
private function handleColour(array|string $colour): array|string
{
if ($colour[0] == '#') {
if (is_string($colour) && $colour[0] == '#') {
$hexToRGB = 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