From ed0ff822ed5652742ff0afe18b4ffa19307b5c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Fri, 17 Jan 2025 23:37:54 +0300 Subject: [PATCH] Refactor CurrencyController to improve method documentation and simplify rate retrieval - Updated PHPDoc comments for methods to enhance clarity, specifically for `getAllRates`, `getCurrentRates`, `getGoldRates`, `getCurrencyRateByName`, and `getGoldRateByName`. - Removed commented-out job dispatching code to streamline the `getAllRates` method. - Adjusted method descriptions to be more concise and focused on their functionality. These changes enhance the maintainability and readability of the CurrencyController, facilitating better management of financial data. --- app/Http/Controllers/CurrencyController.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php index fbb5427..ad026fe 100644 --- a/app/Http/Controllers/CurrencyController.php +++ b/app/Http/Controllers/CurrencyController.php @@ -25,18 +25,13 @@ class CurrencyController extends Controller } /** - * Retrieves all merged currency rates from a JSON file. + * Retrieves all gold and currency rates * * @return \Illuminate\Http\JsonResponse */ public function getAllRates() { - // Job'ı çalıştır - /* - FetchCurrencyRates::dispatchSync(); - FetchGoldRates::dispatchSync(); - MergeCurrencyAndGoldRates::dispatchSync(); - */ + // JSON dosyasından oku $jsonFile = 'merged/rates.json'; if (Storage::exists($jsonFile)) { @@ -49,7 +44,7 @@ class CurrencyController extends Controller } /** - * Retrieves the current currency rates from a JSON file. + * Retrieves the current currency rates * * @return \Illuminate\Http\JsonResponse */ @@ -67,7 +62,7 @@ class CurrencyController extends Controller } /** - * Retrieves the current gold rates from a JSON file. + * Retrieves the current gold rates * * @return \Illuminate\Http\JsonResponse */ @@ -85,7 +80,7 @@ class CurrencyController extends Controller } /** - * Retrieves the currency rate by its name from a JSON file. + * Retrieves the currency rate by its name * * @param string $currencyName * @return \Illuminate\Http\JsonResponse @@ -106,7 +101,7 @@ class CurrencyController extends Controller } /** - * Retrieves the gold rate by its name from a JSON file. + * Retrieves the gold rate by its name * * @param string $goldName * @return \Illuminate\Http\JsonResponse