From 2330b8f50d6eff12071818a3d4f4a9ea2c5b850e Mon Sep 17 00:00:00 2001 From: broadstone-connorbrady Date: Wed, 12 Oct 2022 13:30:39 +0100 Subject: [PATCH] FIXED Imports --- app/Http/Controllers/DecodeController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/DecodeController.php b/app/Http/Controllers/DecodeController.php index 412530a..c4d550a 100644 --- a/app/Http/Controllers/DecodeController.php +++ b/app/Http/Controllers/DecodeController.php @@ -4,13 +4,14 @@ use Dmtx\Reader; use Exception; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Labelary\Client; use Laravel\Lumen\Routing\Controller as BaseController; class DecodeController extends BaseController { - public function isBase64Encoded($data) + public function isBase64Encoded($data): bool { if (preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $data)) { return true; @@ -19,7 +20,8 @@ public function isBase64Encoded($data) } } - public function generateName() { + public function generateName(): string + { $length = 10; $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; @@ -33,7 +35,8 @@ public function generateName() { return $randomString; } - public function decode(Request $request) { + public function decode(Request $request): JsonResponse + { $label = $request->all(); if(!array_key_exists('label', $label)) {