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

Tiqr_UserStorage_Abstract::healthCheck()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
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