Skip to content

API reference / Quittio \ Core \ Countries

CountryRegistry

final class in quittio/core

Quittio\Core\Countries\CountryRegistry · Source

Installed country packs.

Methods#

MethodDescription
->__construct()
->all()
->get()
->getOrGeneric()Returns the installed pack or a generic pack for the country.
->has()
->register()
->taxPreset()The tax preset with this key from the presets of the installed packs, e.g. "de.standard".

__construct()#

public function __construct(iterable<CountryPack> $packs = [])
ParameterTypeDescription
$packsiterable<CountryPack> = []

all()#

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

get()#

public function get(string $code): ?CountryPack
ParameterTypeDescription
$codestring
Returns
?CountryPack

getOrGeneric()#

public function getOrGeneric(string $code): CountryPack

Returns the installed pack or a generic pack for the country.

ParameterTypeDescription
$codestring
Returns
CountryPack

has()#

public function has(string $code): bool
ParameterTypeDescription
$codestring
Returns
bool

register()#

public function register(CountryPack $pack): self
ParameterTypeDescription
$packCountryPack
Returns
self

taxPreset()#

public function taxPreset(string $key): ?TaxPreset

The tax preset with this key from the presets of the installed packs, e.g. "de.standard".

ParameterTypeDescription
$keystring
Returns
?TaxPreset

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.