Completed
Push — master ( 3d39f9...d9b5c0 )
by Anthony
07:02 queued 04:32
created

AbstractMock   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 18
rs 10
1
<?php
2
/**
3
 * The interface that all hash implementations must implement
4
 *
5
 * PHP version 5.3
6
 *
7
 * @category   PHPPasswordLib
8
 * @package    Hash
9
 * @author     Anthony Ferrara <[email protected]>
10
 * @copyright  2011 The Authors
11
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
12
 * @license    http://www.gnu.org/licenses/lgpl-2.1.html LGPL v 2.1
13
 */
14
15
namespace RandomLibTest\Mocks;
16
17
/**
18
 * The interface that all hash implementations must implement
19
 *
20
 * @category   PHPPasswordLib
21
 * @package    Hash
22
 * @author     Anthony Ferrara <[email protected]>
23
 */
24
class AbstractMock {
25
26
    protected $callbacks = array();
27
28
    public static function init() {}
29
30
    public function __construct(array $callbacks = array()) {
31
        $this->callbacks = $callbacks;
32
    }
33
34
    public function __call($name, array $args = array()) {
35
        if (isset($this->callbacks[$name])) {
36
            return call_user_func_array($this->callbacks[$name], $args);
37
        }
38
        return null;
39
    }
40
41
}
42