Random::getStrength()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * The RandomLib library for securely generating random numbers and strings in PHP
5
 *
6
 * @author     Anthony Ferrara <[email protected]>
7
 * @copyright  2011 The Authors
8
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
9
 * @version    Build @@version@@
10
 */
11
12
/**
13
 * The Random Random Number Source
14
 *
15
 * This uses the *nix /dev/random device to generate high strength numbers
16
 *
17
 * PHP version 5.3
18
 *
19
 * @category   PHPCryptLib
20
 * @package    Random
21
 * @subpackage Source
22
 *
23
 * @author     Anthony Ferrara <[email protected]>
24
 * @copyright  2011 The Authors
25
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
26
 *
27
 * @version    Build @@version@@
28
 */
29
namespace RandomLib\Source;
30
31
use SecurityLib\Strength;
32
33
/**
34
 * The Random Random Number Source
35
 *
36
 * This uses the *nix /dev/random device to generate high strength numbers
37
 *
38
 * @category   PHPCryptLib
39
 * @package    Random
40
 * @subpackage Source
41
 *
42
 * @author     Anthony Ferrara <[email protected]>
43
 * @codeCoverageIgnore
44
 */
45
class Random extends URandom
46
{
47
48
    /**
49
     * @var string The file to read from
50
     */
51
    protected static $file = '/dev/random';
52
53
    /**
54
     * Return an instance of Strength indicating the strength of the source
55
     *
56
     * @return \SecurityLib\Strength An instance of one of the strength classes
57
     */
58
    public static function getStrength()
59
    {
60
        return new Strength(Strength::HIGH);
61
    }
62
}
63