Zum Inhalt springen

API reference / Quittio \ Core \ Formats

FormatRegistry

final class in quittio/core

Quittio\Core\Formats\FormatRegistry · Source

Known output formats. Country and network packages can register national formats.

Constants#

ConstantValueDescription
CII'cii'
FACTUR_X'factur-x'
HTML'html'
JSON'json'
PDF'pdf'
PEPPOL'peppol'
UBL'ubl'
ZUGFERD'zugferd'

Methods#

MethodDescription
->alias()Makes $alias (any case) another name for the format $key, e.g. "factur-x" for "zugferd". Changes this instance.
->all()
->get()The format registered under $key or an alias of it (any case).
->has()Whether a format is registered under $key or an alias of it (any case).
->register()Registers $format under its key; it replaces a format registered earlier under the same key. Changes this instance.
::withDefaults()A registry with the built-in formats zugferd (alias factur-x, facturx), cii, ubl, peppol, pdf, html and json.

alias()#

public function alias(string $alias, string $key): self

Makes $alias (any case) another name for the format $key, e.g. "factur-x" for "zugferd". Changes this instance.

ParameterTypeDescription
$aliasstring
$keystring
Returns
self

all()#

public function all(): array<string, OutputFormat>
Returns
array<string, OutputFormat>

get()#

public function get(string $key): OutputFormat

The format registered under $key or an alias of it (any case).

ParameterTypeDescription
$keystring
Returns
OutputFormat
Throws
ConfigurationException – when no such format is registered

has()#

public function has(string $key): bool

Whether a format is registered under $key or an alias of it (any case).

ParameterTypeDescription
$keystring
Returns
bool

register()#

public function register(OutputFormat $format): self

Registers $format under its key; it replaces a format registered earlier under the same key. Changes this instance.

ParameterTypeDescription
$formatOutputFormat
Returns
self

withDefaults()#

public static function withDefaults(): self

static

A registry with the built-in formats zugferd (alias factur-x, facturx), cii, ubl, peppol, pdf, html and json.

Returns
self

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.