Random   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getStrength() 0 4 1
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