Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Push — translatable-with-fallbacks ( b762f4...553845 )
by Pedro
14:20 queued 11:37
created

HasTranslations::setupTranslatorInstance()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 4
eloc 6
c 2
b 1
f 0
nc 3
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
namespace Backpack\CRUD\app\Http\Controllers\Operations\Concerns;
4
5
if (! method_exists(__CLASS__, 'setupTranslatorInstance')) {
6
    trait HasTranslations
7
    {
8
        public function setupTranslatorInstance()
9
        {
10
            if (! method_exists($this->crud->model, 'translationEnabledForModel') || ! class_exists('Spatie\Translatable\Translatable')) {
11
                return;
12
            }
13
14
            if (app('crud')->getOperationSetting('useFallbackLocale')) {
15
                app(\Spatie\Translatable\Translatable::class)->fallback(
16
                    fallbackLocale: app()->getLocale(),
0 ignored issues
show
introduced by
The method getLocale() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

16
                    fallbackLocale: app()->/** @scrutinizer ignore-call */ getLocale(),
Loading history...
17
                    fallbackAny: true,
18
                );
19
            }
20
        }
21
    }
22
}
23