eZ\Publish\Core\Persistence\TransformationProcessor\PcreCompiler::getTransposeClosure PHP Method

getTransposeClosure() protected method

Returns a closure which modifies the provided character by the given value.
protected getTransposeClosure ( string $operator, string $value ) : callback
$operator string
$value string
return callback
    protected function getTransposeClosure($operator, $value)
    {
        $value = hexdec($value) * ($operator === '-' ? -1 : 1);
        $converter = $this->converter;
        return function ($matches) use($value, $converter) {
            return $converter->toUTF8Character($converter->toUnicodeCodepoint($matches[0]) + $value);
        };
    }