Properties

$componentSeparator

$componentSeparator : string

Type

string — The control character used to separate components.

$dataSeparator

$dataSeparator : string

Type

string — The control character used to separate data elements.

$decimalPoint

$decimalPoint : string

Type

string — The control character used as a decimal point.

$escapeCharacter

$escapeCharacter : string

Type

string — The control character used as an escape character.

$segmentTerminator

$segmentTerminator : string

Type

string — The control character used as an segment terminator.

$message

$message : string

Type

string — The message that we are tokenizing.

$char

$char : string|null

Type

string|null — The current character from the message we are dealing with.

$string

$string : string

Type

string — The stored characters for the next token.

$isEscaped

$isEscaped : boolean

Type

boolean — If the current character has been esacped.

Methods

setComponentSeparator()

setComponentSeparator(string  $char) : static

Set the control character used to separate components.

Parameters

string $char

The character to use

Returns

static

setDataSeparator()

setDataSeparator(string  $char) : static

Set the control character used to separate data elements.

Parameters

string $char

The character to use

Returns

static

setDecimalPoint()

setDecimalPoint(string  $char) : static

Set the control character used as a decimal point.

Parameters

string $char

The character to use

Returns

static

setEscapeCharacter()

setEscapeCharacter(string  $char) : static

Set the control character used as an escape character.

Parameters

string $char

The character to use

Returns

static

setSegmentTerminator()

setSegmentTerminator(string  $char) : static

Set the control character used as an segment terminator.

Parameters

string $char

The character to use

Returns

static

getTokens()

getTokens(string  $message) : array<mixed,\Metroplex\Edifact\Token>

Convert the passed message into tokens.

Parameters

string $message

The EDI message

Returns

array<mixed,\Metroplex\Edifact\Token>

setControlCharacter()

setControlCharacter(string  $type, string  $char) : static

Set a control character.

Parameters

string $type

The type of control character to set

string $char

The character to set it to

Returns

static

readNextChar()

readNextChar() : void

Read the next character from the message.

getNextChar()

getNextChar() : void

Get the next character from the message.

getNextToken()

getNextToken() : \Metroplex\Edifact\Token|null

Get the next token from the message.

Returns

\Metroplex\Edifact\Token|null

isControlCharacter()

isControlCharacter() : boolean

Check if the current character is a control character.

Returns

boolean

storeCurrentCharAndReadNext()

storeCurrentCharAndReadNext() : void

Store the current character and read the next one from the message.

extractStoredChars()

extractStoredChars() : string

Get the previously stored characters.

Returns

string

endOfMessage()

endOfMessage() : void

Check if we've reached the end of the message