for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WebnetFr\DatabaseAnonymizer\Generator;
use WebnetFr\DatabaseAnonymizer\Exception\InvalidConstantException;
/**
* Generator that always return constant.
*
* @author Vlad Riabchenko <[email protected]>
*/
class Constant implements GeneratorInterface
{
* Arbitrary constant value.
* @var mixed
private $constant;
* @param $constant
public function __construct($constant)
if (null !== $constant && !\is_string($constant)) {
throw new InvalidConstantException('Constant value must be null or string');
}
$this->constant = $constant;
* {@inheritdoc}
public function generate()
return $this->constant;