Completed
Push — develop ( c99f90...ece1ab )
by Boy
05:54 queued 02:20
created

SecondFactorLocaleProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A determinePreferredLocale() 0 4 1
1
<?php
2
3
namespace Surfnet\StepupGateway\GatewayBundle\Service;
4
5
use Surfnet\StepupBundle\Service\LocaleProviderService;
6
use Surfnet\StepupGateway\GatewayBundle\Saml\Proxy\ProxyStateHandler;
7
8
final class SecondFactorLocaleProvider implements LocaleProviderService
9
{
10
    /**
11
     * @var ProxyStateHandler
12
     */
13
    private $stateHandler;
14
15
    public function __construct(ProxyStateHandler $stateHandler)
16
    {
17
        $this->stateHandler = $stateHandler;
18
    }
19
20
    /**
21
     * @return string
22
     */
23
    public function determinePreferredLocale()
24
    {
25
        return (string) $this->stateHandler->getPreferredLocale();
26
    }
27
}
28