disable phpcs for html code in services

This commit is contained in:
aslan 2024-03-12 13:09:48 +03:00
parent 9e689c8b68
commit ed47971981
2 changed files with 6 additions and 5 deletions

View File

@ -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} <tr class=\"\">
<td id=\"faculty\"> {$faculty->name} </td>
<td>
@ -93,7 +91,7 @@ class CalculatorController extends Controller
<td class=\"text-end\"> {$direction->period} </td>
</tr>";
};
// phpcs:enable
$html = $directions->reduce($generateHtml, '');
return response()->json(['html' => $html]);

View File

@ -13,6 +13,8 @@ class DirectonHtmlBuilder
}
public function getHTML()
{
// phpcs:disable
$direction = $this->direction;
return "<div class=\"offcanvas offcanvas-bottom\" data-bs-scroll=\"true\" data-bs-backdrop=\"false\" tabindex=\"-1\" id=\"offcanvasScrolling-{$direction->id }\" aria-labelledby=\"offcanvasScrollingLabel-{$direction->id}\" style=\"height: 100%; font-family: Geologica-Medium;overflow-y: auto ;\">
<div class=\"mx-5\">
@ -65,4 +67,5 @@ class DirectonHtmlBuilder
</div> ";
}
// phpcs:enable
}