Passed
Push — master ( b697d4...1477cf )
by Frédéric
50s queued 12s
created

other_locale()   A

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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
if (!function_exists('locale_route')) {
4
5
    /**
6
     * Generate the URL to given locale and route name.
7
     *
8
     * @param  string  $locale
9
     * @param  string  $name
10
     * @param  array   $parameters
11
     * @param  bool    $absolute
12
     * @return string
13
     */
14
    function locale_route($locale = null, $name = null, $parameters = null, $absolute = true)
15
    {
16
        return app('locale-route-url')->localeRoute($locale, $name, $parameters, $absolute);
0 ignored issues
show
Bug introduced by
The method localeRoute() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

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

16
        return app('locale-route-url')->/** @scrutinizer ignore-call */ localeRoute($locale, $name, $parameters, $absolute);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
17
    }
18
}
19
20
if (!function_exists('other_locale')) {
21
22
    /**
23
     * Generate the URL for same route name but different locale
24
     *
25
     * @param  string  $locale
26
     * @param  array   $parameters
27
     * @param  bool    $absolute
28
     * @return string
29
     */
30
    function other_locale($locale, $parameters = null, $absolute = true)
31
    {
32
        return app('locale-route-url')->otherLocale($locale, $parameters, $absolute);
0 ignored issues
show
Bug introduced by
The method otherLocale() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

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

32
        return app('locale-route-url')->/** @scrutinizer ignore-call */ otherLocale($locale, $parameters, $absolute);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
33
    }
34
}
35
36
if (!function_exists('other_route')) {
37
    /**
38
     * Generate the URL for same route name but different locale
39
     *
40
     * @param  string  $name
41
     * @param  array   $parameters
42
     * @param  bool    $absolute
43
     * @return string
44
     */
45
    function other_route($name, $parameters = null, $absolute = true)
46
    {
47
        return app('locale-route-url')->otherRoute($name, $parameters, $absolute);
0 ignored issues
show
Bug introduced by
The method otherRoute() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

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

47
        return app('locale-route-url')->/** @scrutinizer ignore-call */ otherRoute($name, $parameters, $absolute);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
48
    }
49
}
50