Completed
Push — master ( 79320b...fce3d5 )
by Chin
06:22
created

RequestMacros::localizedRouteIs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ChinLeung\LaravelMultilingualRoutes\Macros;
4
5
use Closure;
6
7
class RequestMacros
8
{
9
    /**
10
     * Determine if the route name matches a given pattern in the current
11
     * locale.
12
     *
13
     * @param  mixed  ...$patterns
14
     * @return \Closure
15
     */
16
    public function localizedRouteIs(): Closure
17
    {
18
        return function (...$patterns) {
19
            return $this->routeIs(array_map(function ($pattern) {
0 ignored issues
show
Bug introduced by
The method routeIs() does not exist on ChinLeung\LaravelMultili...es\Macros\RequestMacros. Did you maybe mean localizedRouteIs()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
20
                return locale().".{$pattern}";
21
            }, $patterns));
22
        };
23
    }
24
}
25