These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | if ( ! function_exists('localization')) { |
||
4 | /** |
||
5 | * Get the Localization instance. |
||
6 | * |
||
7 | * @return Arcanedev\Localization\Contracts\Localization |
||
8 | */ |
||
9 | function localization() |
||
10 | { |
||
11 | return app(Arcanedev\Localization\Contracts\Localization::class); |
||
12 | } |
||
13 | } |
||
14 | |||
15 | if ( ! function_exists('localized_route')) { |
||
16 | /** |
||
17 | * Get a localized URL with a given trans route name. |
||
18 | * |
||
19 | * @return string |
||
20 | */ |
||
21 | function localized_route($route, $parameters = [], $locale = null) |
||
0 ignored issues
–
show
|
|||
22 | { |
||
23 | if (is_null($locale)) |
||
24 | $locale = localization()->getCurrentLocale(); |
||
25 | |||
26 | return localization()->getUrlFromRouteName($locale, $route, $parameters); |
||
27 | } |
||
28 | } |
||
29 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.