for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace SlayerBirden\DataFlowServer\Doctrine\Hydrator\Strategy;
use Zend\Hydrator\Strategy\StrategyInterface;
final class RegexpObscuredStrategy implements StrategyInterface
{
/**
* @var string
*/
private $pattern;
private $replacement;
public function __construct(string $pattern, string $replacement = '')
$this->pattern = $pattern;
$this->replacement = $replacement;
}
* @inheritdoc
public function extract($value)
if (!empty($value) && preg_match($this->pattern, $value)) {
return preg_replace($this->pattern, $this->replacement, $value);
return $value;
public function hydrate($value)