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 — master (#3654)
by
unknown
13:52
created

SlugService::makeSlugUnique()   B

Complexity

Conditions 9
Paths 9

Size

Total Lines 47
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 9
eloc 22
nc 9
nop 3
dl 0
loc 47
rs 8.0555
c 0
b 0
f 0
1
<?php
2
3
namespace Backpack\CRUD\app\Models\Traits\SpatieTranslatable;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class SlugService extends \Cviebrock\EloquentSluggable\Services\SlugService
0 ignored issues
show
Bug introduced by
The type Cviebrock\EloquentSluggable\Services\SlugService was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
{
9
    /**
10
     * Slug the current model.
11
     *
12
     * @param \Illuminate\Database\Eloquent\Model $model
13
     * @param bool                                $force
14
     *
15
     * @return bool
16
     */
17
    public function slug(Model $model, bool $force = false): bool
18
    {
19
        $this->setModel($model);
20
21
        $attributes = [];
22
23
        foreach ($this->model->sluggable() as $attribute => $config) {
24
            if (is_numeric($attribute)) {
25
                $attribute = $config;
26
                $config = $this->getConfiguration();
27
            } else {
28
                $config = $this->getConfiguration($config);
29
            }
30
31
            $slug = $this->buildSlug($attribute, $config, $force);
32
33
            // customized for Backpack using SpatieTranslatable
34
            // save the attribute as a JSON
35
            $this->model->setAttribute($attribute.'->'.$model->getLocale(), $slug);
0 ignored issues
show
Bug introduced by
Are you sure $model->getLocale() of type Illuminate\Database\Eloquent\Builder|mixed can be used in concatenation? ( Ignorable by Annotation )

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

35
            $this->model->setAttribute($attribute.'->'./** @scrutinizer ignore-type */ $model->getLocale(), $slug);
Loading history...
36
37
            $attributes[] = $attribute;
38
        }
39
40
        return $this->model->isDirty($attributes);
41
    }
42
}
43