Total Complexity | 5 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
5 | class RandomValue implements ValueMergerInterface |
||
6 | { |
||
7 | use InvokeMergeTrait; |
||
8 | |||
9 | /** |
||
10 | * RandomValue constructor. |
||
11 | * |
||
12 | * @param int $seed |
||
13 | */ |
||
14 | 3 | public function __construct($seed = null) |
|
15 | { |
||
16 | 3 | if (!is_null($seed) && is_int($seed)) { |
|
17 | 1 | mt_srand($seed); |
|
18 | } |
||
19 | 3 | } |
|
20 | |||
21 | /** |
||
22 | * Return a random result |
||
23 | * |
||
24 | * @param mixed $value1 |
||
25 | * @param mixed $value2 |
||
26 | * |
||
27 | * @return mixed |
||
28 | */ |
||
29 | 3 | public function merge($value1, $value2) |
|
32 | } |
||
33 | } |
||
34 |