Completed
Push — master ( f22aed...46f558 )
by Chin
03:14
created

RequestMacros   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A localizedRouteIs() 0 8 1
1
<?php
2
3
namespace ChinLeung\MultilingualRoutes\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\MultilingualRoutes\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