<commit_before><?php

namespace App\Http\Controllers;

use App\Booth;
use App\Club;
use App\User;
use Illuminate\Http\Request;

class HomeController extends Controller
{
    public function index()
    {
        /** @var User $user */
        $user = auth()->user();
        if ($user && $user->student) {
            $student = $user->student;
            $student->load('records.club.clubType', 'qrcodes.student');

            return view('dashboard', compact('student'));
        }

        return view('index');
    }

    public function clubs()
    {
        return view('clubs.index');
    }

    public function clubsShow(Club $club)
    {
        return view('club.show', compact('club'));
    }

    public function clubsMap(Request $request)
    {
        $type = $request->input('type') ?: 'static';

        if (!in_array($type, ['static', 'google'])) {
            $type = 'static';
        }

        $boothData = [];
        if ($type == 'google') {
            $booths = Booth::with(['club'])->get();
            /** @var Booth $booth */
            foreach ($booths as $booth) {
                $boothData[] = [
                    'name'      => $booth->name,
                    'longitude' => $booth->longitude,
                    'latitude'  => $booth->latitude,
                    'club_name' => $booth->club->name ?? null,
                    'fillColor' => $booth->club->clubType->color ?? '#00DD00',
                    'url'       =>
                        is_null($booth->club) ? 'javascript:void(0);' : route('clubs.show', $booth->club->id),
                ];
            }
        }

        return view('map', compact('type', 'boothData'));
    }
}
<commit_msg>Reformat<commit_after><?php

namespace App\Http\Controllers;

use App\Booth;
use App\Club;
use App\User;
use Illuminate\Http\Request;

class HomeController extends Controller
{
    public function index()
    {
        /** @var User $user */
        $user = auth()->user();
        if ($user && $user->student) {
            $student = $user->student;
            $student->load('records.club.clubType', 'qrcodes.student');

            return view('dashboard', compact('student'));
        }

        return view('index');
    }

    public function clubs()
    {
        return view('clubs.index');
    }

    public function clubsShow(Club $club)
    {
        return view('club.show', compact('club'));
    }

    public function clubsMap(Request $request)
    {
        $type = $request->input('type') ?: 'static';

        if (!in_array($type, ['static', 'google'])) {
            $type = 'static';
        }

        $boothData = [];
        if ($type == 'google') {
            $booths = Booth::with(['club'])->get();
            /** @var Booth $booth */
            foreach ($booths as $booth) {
                $boothData[] = [
                    'name'      => $booth->name,
                    'longitude' => $booth->longitude,
                    'latitude'  => $booth->latitude,
                    'club_name' => $booth->club->name ?? null,
                    'fillColor' => $booth->club->clubType->color ?? '#00DD00',
                    'url'       => is_null($booth->club)
                        ? 'javascript:void(0);'
                        : route('clubs.show', $booth->club->id),
                ];
            }
        }

        return view('map', compact('type', 'boothData'));
    }
}

{'fraction_non_alphanumeric': 0.17228244945795487, 'fraction_numerical': 0.002929973630237328, 'mean_word_length': 1.6609508963367108, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5381257', 'n_tokens_mistral': 1019, 'n_tokens_neox': 977, 'n_words': 190}