for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Graze\ArrayMerger\ValueMerger;
class RandomValue implements ValueMergerInterface
{
use InvokeMergeTrait;
/**
* RandomValue constructor.
*
* @param int $seed
*/
public function __construct($seed = null)
if (!is_null($seed) && is_int($seed)) {
mt_srand($seed);
}
* Return a random result
* @param mixed $value1
* @param mixed $value2
* @return mixed
public function merge($value1, $value2)
return (mt_rand(1, 2) == 1) ? $value1 : $value2;