Completed
Push — master ( ca46fd...1d0b8e )
by
unknown
19:27 queued 09:34
created

LocaleController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 11 2
1
<?php
2
3
namespace BBSLab\NovaTranslation\Http\Controllers;
4
5
use BBSLab\NovaTranslation\Models\Locale;
6
use BBSLab\NovaTranslation\NovaTranslation;
7
use Illuminate\Http\Request;
8
9
class LocaleController
10
{
11
    public function __invoke(Request $request, string $locale)
12
    {
13
        if (Locale::query()->where('iso', '=', $locale)->exists()) {
0 ignored issues
show
Bug introduced by
The method exists() does not exist on Illuminate\Database\Eloquent\Builder. Did you maybe mean canUseExistsForExistenceCheck()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
14
            $request->session()->put(
15
                NovaTranslation::localeSessionKey(),
16
                $locale
17
            );
18
        }
19
20
        return redirect()->back();
21
    }
22
}
23