RestNormalizer

Normalization data for the transmission via "Representational State Transfer"

Summary

Methods
Properties
Constants
__construct()
setValidation()
normalize()
$encoding
$clear
$logFile
No constants found
onPreNormalize()
onPostNormalize()
No protected properties found
N/A
parseConfig()
formatting()
setFormat()
setString()
setInt()
setDouble()
setBool()
setDateTime()
setEnum()
multiIconv()
$formatMessage
$validation
$originalValidation
N/A

Properties

$encoding

$encoding : string

Encoding output values

Type

string

$clear

$clear : boolean

Cleanup of null values

Type

boolean

$logFile

$logFile : string

The path to the file for logging

Type

string

$formatMessage

$formatMessage : string

Text format for logging

Type

string

$validation

$validation : array

Sorted file validation

Type

array

$originalValidation

$originalValidation : array

File validation

Type

array

Methods

__construct()

__construct() : void

Class constructor

setValidation()

setValidation(string  $file) : void

Installation file validation

Parameters

string $file

The path to the file validation

normalize()

normalize(array  $data, string  $key = false) : array

Starting the process of normalization of the data

Parameters

array $data

The key is to sort the data validation

string $key

Data normalization

Returns

array

onPreNormalize()

onPreNormalize(array  $data) : array

Preprocessing data

Parameters

array $data

Returns

array

onPostNormalize()

onPostNormalize(array  $data) : array

Post-processing of data

Parameters

array $data

Returns

array

parseConfig()

parseConfig(string  $file) : boolean

Parsing the file validation

Parameters

string $file

The path to the file validation

Returns

boolean

formatting()

formatting(array  $data, boolean  $skip = false) : array

Data formatting

Parameters

array $data

The key is to sort the data validation

boolean $skip

Skip perform methods intended for the first run

Returns

array

setFormat()

setFormat(mixed  $data, array  $validation) : mixed

Formatting data depending on the type

Parameters

mixed $data

The value to be formatted

array $validation

The data for the current data type validation

Returns

mixed

setString()

setString(string  $data, array  $validation) : string

Formatting data for strings

Parameters

string $data

String to formatting

array $validation

The data for the current data type validation

Returns

string

setInt()

setInt(integer  $data, array  $validation) : integer

Formatting data for integers

Parameters

integer $data

Integer to formatting

array $validation

The data for the current data type validation

Returns

integer

setDouble()

setDouble(float  $data, array  $validation) : float

Formatting data for floating-point numbers

Parameters

float $data

Floating-point number to formatting

array $validation

The data for the current data type validation

Returns

float

setBool()

setBool(boolean  $data, array  $validation) : boolean

Formatting data for logical values

Parameters

boolean $data

Boolean value to formatting

array $validation

The data for the current data type validation

Returns

boolean

setDateTime()

setDateTime(mixed  $data, array  $validation, boolean  $skip = false) : mixed

Formatting data for date and time

Parameters

mixed $data

Date and time of to formatting

array $validation

The data for the current data type validation

boolean $skip

Skip perform methods intended for the first run

Returns

mixed

setEnum()

setEnum(string  $data, array  $validation) : string

Formatting data for enum

Parameters

string $data

Enum to formatting

array $validation

The data for the current data type validation

Returns

string

multiIconv()

multiIconv(array  $data) : array

Installing the specified encoding

Parameters

array $data

The original dataset

Returns

array