Passed
Push — master ( 63c666...b91fac )
by Pieter van der
03:51
created

Tiqr_UserStorage_Abstract   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 2
b 0
f 0
dl 0
loc 26
ccs 2
cts 6
cp 0.3333
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAdditionalAttributes() 0 3 1
A __construct() 0 3 1
A healthCheck() 0 3 1
1
<?php 
2
/**
3
 * This file is part of the tiqr project.
4
 * 
5
 * The tiqr project aims to provide an open implementation for 
6
 * authentication using mobile devices. It was initiated by 
7
 * SURFnet and developed by Egeniq.
8
 *
9
 * More information: http://www.tiqr.org
10
 *
11
 * @author Peter Verhage <[email protected]>
12
 * 
13
 * @package tiqr
14
 *
15
 * @license New BSD License - See LICENSE file for details.
16
 *
17
 * @copyright (C) 2010-2012 SURFnet BV
18
 */
19
20
use Psr\Log\LoggerInterface;
21
22
/**
23
 * Abstract base implementation for user storage. 
24
 *
25
 * Adds built-in support for encryption of the user secret.
26
 * 
27
 * @author peter
28
 */
29
abstract class Tiqr_UserStorage_Abstract implements Tiqr_UserStorage_Interface, Tiqr_HealthCheck_Interface
30
{
31
    protected LoggerInterface $logger;
32
33 8
    public function __construct(array $config, LoggerInterface $logger)
34
    {
35 8
        $this->logger = $logger;
36
    }
37
38
    /**
39
     * Returns additional attributes for the user.
40
     *
41
     * @param string $userId User identifier.
42
     * @return array additional user attributes
43
     */
44
    public function getAdditionalAttributes(string $userId): array
45
    {
46
        return array();
47
    }
48
49
    /**
50
     * @see Tiqr_HealthCheck_Interface::healthCheck()
51
     */
52
    public function healthCheck(string &$statusMessage = ''): bool
53
    {
54
        return true;    // Health check is always successful when not implemented
55
    }
56
}
57