API reference / Quittio \ Core \ Countries
CountryRegistry
final class in quittio/core
Quittio\Core\Countries\CountryRegistry · Source
Installed country packs.
Methods#
| Method | Description |
|---|---|
->__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 = [])| Parameter | Type | Description |
|---|---|---|
$packs | iterable<CountryPack> = [] |
all()#
public function all(): array<string, CountryPack>- Returns
array<string, CountryPack>
get()#
public function get(string $code): ?CountryPack| Parameter | Type | Description |
|---|---|---|
$code | string |
- Returns
?CountryPack
getOrGeneric()#
public function getOrGeneric(string $code): CountryPackReturns the installed pack or a generic pack for the country.
| Parameter | Type | Description |
|---|---|---|
$code | string |
- Returns
CountryPack
has()#
public function has(string $code): bool| Parameter | Type | Description |
|---|---|---|
$code | string |
- Returns
bool
register()#
public function register(CountryPack $pack): self| Parameter | Type | Description |
|---|---|---|
$pack | CountryPack |
- Returns
self
taxPreset()#
public function taxPreset(string $key): ?TaxPresetThe tax preset with this key from the presets of the installed packs, e.g. "de.standard".
| Parameter | Type | Description |
|---|---|---|
$key | string |
- Returns
?TaxPreset