functions.php ➔ translug()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 10
ccs 0
cts 7
cp 0
crap 6
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
use Illuminate\Support\Str;
4
5
if (!function_exists('translug')) {
6
7
    /**
8
     * Text to translug.
9
     *
10
     * @param string|null $text.
0 ignored issues
show
Bug introduced by
There is no parameter named $text.. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
11
     *
12
     * @return
13
     */
14
    function translug($text = '')
15
    {
16
        $translator = app('translug');
17
18
        if (!is_null($text)) {
19
            return $translator->translug($text);
20
        }
21
22
        return $translator;
23
    }
24
}
25
26
if (!function_exists('str_slug')) {
27
28
    /**
29
     * Text to translug.
30
     *
31
     * @param string|null $text.
0 ignored issues
show
Bug introduced by
There is no parameter named $text.. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
32
     *
33
     * @return
34
     */
35
    function str_slug($text = '')
36
    {
37
        return Str::slug($text);
38
    }
39
}
40