slug_get_id()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php
2
3
if (! function_exists('slug_get_model')) {
4
    function slug_get_model($slug, $class = null)
5
    {
6
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getModel($slug, $class);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

6
        return /** @scrutinizer ignore-call */ app(\Fomvasss\SlugMaker\SlugHelper::class)->getModel($slug, $class);
Loading history...
7
    }
8
}
9
10
if (! function_exists('slug_get_models')) {
11
    function slug_get_models($slugs, $class = null)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
12
    {
13
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getModels($slugs, $class);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

13
        return /** @scrutinizer ignore-call */ app(\Fomvasss\SlugMaker\SlugHelper::class)->getModels($slugs, $class);
Loading history...
14
    }
15
}
16
17
if (! function_exists('slug_get_id')) {
18
    function slug_get_id($slug, $class = null)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
19
    {
20
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getId($slug, $class);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

20
        return /** @scrutinizer ignore-call */ app(\Fomvasss\SlugMaker\SlugHelper::class)->getId($slug, $class);
Loading history...
21
    }
22
}
23
24
if (! function_exists('slug_get_ids')) {
25
    function slug_get_ids($slugs, $class = null)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
26
    {
27
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getIds($slugs, $class);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

27
        return /** @scrutinizer ignore-call */ app(\Fomvasss\SlugMaker\SlugHelper::class)->getIds($slugs, $class);
Loading history...
28
    }
29
}
30
31
if (! function_exists('slug_get_grouped_class')) {
32
    function slug_get_grouped_class($attributes, $useId = false)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
33
    {
34
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getIdsGroupedByClass($attributes, $useId);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

34
        return /** @scrutinizer ignore-call */ app(\Fomvasss\SlugMaker\SlugHelper::class)->getIdsGroupedByClass($attributes, $useId);
Loading history...
35
    }
36
}
37
38
if (! function_exists('slug_get')) {
39
    function slug_get($model)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
40
    {
41
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getSlugName($model);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

41
        return /** @scrutinizer ignore-call */ app(\Fomvasss\SlugMaker\SlugHelper::class)->getSlugName($model);
Loading history...
42
    }
43
}
44
45
if (! function_exists('slug_make')) {
46
    function slug_make($model, $slug = '')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
47
    {
48
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->makeForModel($model, $slug);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

48
        return /** @scrutinizer ignore-call */ app(\Fomvasss\SlugMaker\SlugHelper::class)->makeForModel($model, $slug);
Loading history...
49
    }
50
}
51
52
if (! function_exists('slug_delete')) {
53
    function slug_delete($model)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
54
    {
55
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->deleteByModel($model);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

55
        return /** @scrutinizer ignore-call */ app(\Fomvasss\SlugMaker\SlugHelper::class)->deleteByModel($model);
Loading history...
56
    }
57
}
58