Tiqr_DeviceStorage_Abstract::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 2
c 2
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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 Ivo Jansch <[email protected]>
12
 * 
13
 * @package tiqr
14
 *
15
 * @license New BSD License - See LICENSE file for details.
16
 *
17
 * @copyright (C) 2010-2011 SURFnet BV
18
 */
19
20
use Psr\Log\LoggerInterface;
21
22
23
/**
24
 * The abstract baseclass for DeviceStorage implementations
25
 * @author ivo
26
 *
27
 */
28
abstract class Tiqr_DeviceStorage_Abstract
29
{
30
    /**
31
     * The options available to the devicestorage implementation
32
     * @var array
33
     */
34
    protected $_options = array();
35
36
    /** @var LoggerInterface */
37
    protected $logger;
38
    
39
    /**
40
     * get a deviceToken for a certain notificationToken.
41
     * @param String $notificationToken
42
     * @return String|bool deviceToken, false on error
43
     */
44
    public abstract function getDeviceToken(string $notificationToken);
45
           
46
    /**
47
     * Initialize the devicestorage instance right after creation. 
48
     * The derived classes may optionally use this to initialize the
49
     * storage.
50
     */
51 10
    public function init(): void
52
    {
53
        
54 10
    }
55
56
    /**
57
     * Create an instance of a device storage. Should not be used directly, as
58
     * the Tiqr_DeviceStorage factory will call this for you.
59
     * @param array $options The options
60
     * @param LoggerInterface $logger
61
     */
62 10
    public function __construct(array $options, LoggerInterface $logger)
63
    {
64 10
        $this->_options = $options;
65 10
        $this->logger = $logger;
66
    }
67
        
68
}
69