PHP Class eZ\Publish\Core\Persistence\TransformationProcessor\PcreCompiler

Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$converter eZ\Publish\Core\Persistence\Utf8Converter Class for converting UTF-8 characters.

Public Methods

Method Description
__construct ( Utf8Converter $converter ) Construct from UTF8Converter.
compile ( array $ast ) : array Compile AST into a set of regular expressions.

Protected Methods

Method Description
compileCharacter ( string $char ) : string Compile a single source character definition into a plain UTF-8 character.
compileMap ( array $rule ) : array Compile map rule.
compileReplace ( array $rule ) : array Compile replace rule.
compileRule ( array $rule ) : array Compiles a single rule.
compileTargetCharacter ( string $char ) : callback Compile target into a closure, which can be used by preg_replace_callback.
compileTranspose ( array $rule ) : array Compile transpose rule.
compileTransposeModulo ( array $rule ) : array Compile transpose modulo rule.
getModuloCharRange ( string $start, string $end, string $modulo ) : string Get string with all characters defined by parameters.
getTransposeClosure ( string $operator, string $value ) : callback Returns a closure which modifies the provided character by the given value.

Method Details

__construct() public method

Construct from UTF8Converter.
public __construct ( Utf8Converter $converter )
$converter eZ\Publish\Core\Persistence\Utf8Converter

compile() public method

The returned array contains a set of regular expressions and their replacement callbacks. The regular expressions can then be applied to strings to executed the transformations.
public compile ( array $ast ) : array
$ast array
return array

compileCharacter() protected method

Handles the two formats from the possible character definitions: - U+xxxx : Unicode value in hexadecimal - xx: Ascii value in hexadecimal
protected compileCharacter ( string $char ) : string
$char string
return string

compileMap() protected method

Compile map rule.
protected compileMap ( array $rule ) : array
$rule array
return array

compileReplace() protected method

Compile replace rule.
protected compileReplace ( array $rule ) : array
$rule array
return array

compileRule() protected method

Compiles a single rule.
protected compileRule ( array $rule ) : array
$rule array
return array

compileTargetCharacter() protected method

Compile target into a closure, which can be used by preg_replace_callback.
protected compileTargetCharacter ( string $char ) : callback
$char string
return callback

compileTranspose() protected method

Compile transpose rule.
protected compileTranspose ( array $rule ) : array
$rule array
return array

compileTransposeModulo() protected method

Compile transpose modulo rule.
protected compileTransposeModulo ( array $rule ) : array
$rule array
return array

getModuloCharRange() protected method

Returns a string containing all UTF-8 characters starting with the specified $start character up to the $end character with the step size defined in $modulo.
protected getModuloCharRange ( string $start, string $end, string $modulo ) : string
$start string
$end string
$modulo string
return string

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

Property Details

$converter protected property

Class for converting UTF-8 characters.
protected Utf8Converter,eZ\Publish\Core\Persistence $converter
return eZ\Publish\Core\Persistence\Utf8Converter