From ed47971981eb90637891f0b68ba6bbddfd2680a8 Mon Sep 17 00:00:00 2001 From: aslan Date: Tue, 12 Mar 2024 13:09:48 +0300 Subject: [PATCH] disable phpcs for html code in services --- app/Http/Controllers/Api/CalculatorController.php | 8 +++----- app/Services/DirectonHtmlBuilder.php | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Api/CalculatorController.php b/app/Http/Controllers/Api/CalculatorController.php index 96dfa79..73065e8 100644 --- a/app/Http/Controllers/Api/CalculatorController.php +++ b/app/Http/Controllers/Api/CalculatorController.php @@ -9,7 +9,6 @@ use App\Models\EntranceExamination; use App\Models\Faculty; use Illuminate\Http\Request; - class CalculatorController extends Controller { public function findDirectionFromSubjects(Request $request) @@ -24,8 +23,7 @@ class CalculatorController extends Controller ->map(function ($direction) { return $direction->map(fn($item) => $item['subject_id']); }) - ->filter(fn($direction) => count($direction) <= $countUserSubjects) - ->keys(); + ->filter(fn($direction) => count($direction) <= $countUserSubjects)->keys(); $directions = Direction::whereIn('id', $filteredDirectionIds)->get(); @@ -33,7 +31,7 @@ class CalculatorController extends Controller $generateHtml = function ($acc, $direction) { $department = Department::find($direction->department_id); $faculty = Faculty::find($department->faculty_id); - + // phpcs:disable return "{$acc} {$faculty->name} @@ -93,7 +91,7 @@ class CalculatorController extends Controller {$direction->period} "; }; - + // phpcs:enable $html = $directions->reduce($generateHtml, ''); return response()->json(['html' => $html]); diff --git a/app/Services/DirectonHtmlBuilder.php b/app/Services/DirectonHtmlBuilder.php index 1456895..cb25015 100644 --- a/app/Services/DirectonHtmlBuilder.php +++ b/app/Services/DirectonHtmlBuilder.php @@ -13,6 +13,8 @@ class DirectonHtmlBuilder } public function getHTML() { + // phpcs:disable + $direction = $this->direction; return "
id }\" aria-labelledby=\"offcanvasScrollingLabel-{$direction->id}\" style=\"height: 100%; font-family: Geologica-Medium;overflow-y: auto ;\">
@@ -65,4 +67,5 @@ class DirectonHtmlBuilder
"; } + // phpcs:enable }