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
Pull Request — main (#4267)
by Pedro
26:44 queued 11:39
created

HasTranslations

Complexity

Total Complexity 0

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 1
c 3
b 1
f 0
dl 0
loc 14
wmc 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setupTranslatorInstance() 0 12 4
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
                    fallbackAny: true,
17
                );
18
19
                return;
20
            }
21
        }
22
    }
23
} else {
24
    trait HasTranslations
25
    {
26
    }
27
}
28