CookieStore   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 17
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A store() 0 7 1
1
<?php
2
3
namespace CodeZero\Localizer\Stores;
4
5
use Illuminate\Support\Facades\Config;
6
use Illuminate\Support\Facades\Cookie;
7
8
class CookieStore implements Store
9
{
10
    /**
11
     * Store the given locale.
12
     *
13
     * @param string $locale
14
     *
15
     * @return void
16
     */
17 7
    public function store($locale)
18
    {
19 7
        $name = Config::get('localizer.cookie-name');
20 7
        $minutes = Config::get('localizer.cookie-minutes');
21
22 7
        Cookie::queue($name, $locale, $minutes);
0 ignored issues
show
Unused Code introduced by
The call to Cookie::queue() has too many arguments starting with $locale.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
23 7
    }
24
}
25