Civil Date PHP Package

NumberParseResult
in package

FinalYes

Carries the outcome of parsing a localized number.

Table of Contents

Methods

failure()  : self
Creates a failed parse result.
failureReason()  : NumberParseFailureReason|null
Returns why the parse failed.
form()  : NumberForm|null
Returns the parsed number form.
invalidWord()  : string|null
Returns the invalid word associated with the failure.
succeeded()  : bool
Returns whether the parse succeeded.
success()  : self
Creates a successful parse result.
value()  : int|null
Returns the parsed value.

Methods

invalidWord()

Returns the invalid word associated with the failure.

public invalidWord() : string|null
Return values
string|null

Invalid word, or null when none was identified.

succeeded()

Returns whether the parse succeeded.

public succeeded() : bool
Return values
bool

True when the parse succeeded.

success()

Creates a successful parse result.

public static success(int $value, NumberForm $form) : self
Parameters
$value : int

Parsed value.

$form : NumberForm

Parsed number form.

Return values
self

Successful parse result.

value()

Returns the parsed value.

public value() : int|null
Return values
int|null

Parsed value, or null on failure.

On this page

Search results