DetectLocaleMiddlewareSpy   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __call() 0 4 2
1
<?php
2
3
namespace TractorCow\Fluent\Tests\Middleware\Stub;
4
5
use SilverStripe\Control\HTTPRequest;
6
use TractorCow\Fluent\Middleware\DetectLocaleMiddleware;
7
use SilverStripe\Dev\TestOnly;
8
9
/**
10
 * Opens up DetectLocaleMiddleware protected methods for unit testing
11
 *
12
 * @method string getPersistKey()
13
 * @method $this setPersistLocale(HTTPRequest $request, $locale)
14
 * @method string getLocale(HTTPRequest $request)
15
 */
16
class DetectLocaleMiddlewareSpy extends DetectLocaleMiddleware implements TestOnly
17
{
18
    public function __call($method, $arguments)
19
    {
20
        if (method_exists($this, $method)) {
21
            return $this->$method(...$arguments);
22
        }
23
    }
24
}
25