Civil Date PHP Package

TokenElement
in package
implements PatternElement

FinalYes

Associates a token rule with its pattern symbol and optional calendar scope.

Tags
see
TokenRule
TokenRegistry

Table of Contents

Interfaces

PatternElement
Represents an element in a compiled date pattern.

Methods

__construct()  : mixed
Creates a date-pattern token element.
calendar()  : Calendar|null
Returns the explicit calendar scope of this token.
format()  : string
Formats this token for a date.
rule()  : TokenRule
Returns the token rule.
symbol()  : string
Returns the pattern token symbol.

Methods

__construct()

Creates a date-pattern token element.

public __construct(string $symbol, Calendar|null $calendar, TokenRule $rule) : mixed
Parameters
$symbol : string

Pattern token symbol.

$calendar : Calendar|null

Explicit calendar, or null when unscoped.

$rule : TokenRule

Token behavior.

calendar()

Returns the explicit calendar scope of this token.

public calendar() : Calendar|null
Return values
Calendar|null

Explicit calendar, or null when unscoped.

symbol()

Returns the pattern token symbol.

public symbol() : string
Return values
string

Pattern token symbol.

On this page

Search results