Passed
Push — master ( 51edae...d29a9b )
by Curtis
11:52 queued 05:54
created

Update::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 7
rs 10
1
<?php
2
3
namespace App\Http\Controllers\enso\Localisation\Json;
4
5
use Illuminate\Http\Request;
6
use App\Models\enso\Localisation\Language;
7
use App\Service\enso\Localisation\Json\Updater;
8
9
class Update
10
{
11
    public function __invoke(Request $request, Language $language, string $subDir)
12
    {
13
        (new Updater(
14
            $language, $request->get('langFile'), $subDir
0 ignored issues
show
Bug introduced by
It seems like $request->get('langFile') can also be of type null; however, parameter $langArray of App\Service\enso\Localis...\Updater::__construct() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

14
            $language, /** @scrutinizer ignore-type */ $request->get('langFile'), $subDir
Loading history...
15
        ))->run();
16
17
        return ['message' => __('The language files were successfully updated')];
18
    }
19
}
20