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

Mixer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 43
rs 10
1
<?php
2
/**
3
 * The Mixer strategy interface.
4
 *
5
 * All mixing strategies must implement this interface
6
 *
7
 * PHP version 5.3
8
 *
9
 * @category   PHPPasswordLib
10
 * @package    Random
11
 * @author     Anthony Ferrara <[email protected]>
12
 * @copyright  2011 The Authors
13
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
14
 * @license    http://www.gnu.org/licenses/lgpl-2.1.html LGPL v 2.1
15
 */
16
17
namespace RandomLibTest\Mocks\Random;
18
19
use SecurityLib\Strength;
20
/**
21
 * The Mixer strategy interface.
22
 *
23
 * All mixing strategies must implement this interface
24
 *
25
 * @category   PHPPasswordLib
26
 * @package    Random
27
 * @author     Anthony Ferrara <[email protected]>
28
 */
29
class Mixer extends \RandomLibTest\Mocks\AbstractMock implements \RandomLib\Mixer {
30
31
    public static $strength = null;
32
33
    public static $test = true;
34
35
    public static function init() {
36
        static::$strength = new Strength(Strength::HIGH);
37
        static::$test = true;
38
    }
39
40
    /**
41
     * Return an instance of Strength indicating the strength of the mixer
42
     *
43
     * @return Strength An instance of one of the strength classes
44
     */
45
    public static function getStrength() {
46
        return static::$strength;
47
    }
48
49
    /**
50
     * Test to see if the mixer is available
51
     *
52
     * @return boolean If the mixer is available on the system
53
     */
54
    public static function test() {
55
        return static::$test;
56
    }
57
58
    /**
59
     * Mix the provided array of strings into a single output of the same size
60
     *
61
     * All elements of the array should be the same size.
62
     *
63
     * @param array $parts The parts to be mixed
64
     *
65
     * @return string The mixed result
66
     */
67
    public function mix(array $parts) {
68
        return $this->__call('mix', array($parts));
69
    }
70
71
}
72