API Reference

Auto-gegenereerd via Reflection — blijft altijd in sync met src/.

Filter: alleAppCacheCmsDbDebugDynamicEventsFilesFormHtmlHttpImageLogMediaSecuritySessionStdlibSupportView

Address

Framework\Support\Address
final class

Postadres als immutable DTO.

$a = new Address(
street: 'Amstelplein',
houseNumber: '1',
postcode: '1096 HA',
city: 'Amsterdam',
country: 'NL',
);

$a->lines(); // ['Amstelplein 1', '1096 HA Amsterdam', 'NL']
(string) $a; // "Amstelplein 1\n1096 HA Amsterdam\nNL"

__construct(string $street, string $houseNumber, string $postcode, string $city, string $country = 'NL', ?string $houseNumberSuffix = NULL, ?string $region = NULL)
3 public methods
equals(self $other): bool
lines(): array

Postadres opgesplitst in regels, klaar voor weergave.

withHouseNumber(string $number, ?string $suffix = NULL): self

Color

Framework\Support\Color
final class

Kleur als RGBA-DTO (0-255 + alpha 0-1).

Color::fromHex('#a5b4fc'); // r=165 g=180 b=252 a=1
Color::fromHex('#abc'); // shorthand expanded
Color::fromRgb(255, 0, 0)->toHex(); // "#ff0000"
Color::fromHex('#000', alpha: 0.5)->toRgba(); // "rgba(0,0,0,0.5)"

__construct(int $r, int $g, int $b, float $alpha = 1.0)
10 public methods
equals(self $other): bool
static fromHex(string $hex, float $alpha = 1.0): self

Accepteert "#abc", "#aabbcc", "abc", "aabbcc", "#aabbccdd" (RGBA hex).

static fromRgb(int $r, int $g, int $b, float $alpha = 1.0): self
isLight(): bool

Quick check: is een witte- of zwarte voorgrond beter?

luminance(): float

Relatieve luminantie volgens WCAG (0-1).

toHex(bool $withAlpha = false): string
toRgb(): string
toRgba(): string
static tryParse(string $input): ?self
withAlpha(float $alpha): self

Currency

Framework\Support\Currency
enum

ISO-4217 currency codes (subset). Aanvullen waar nodig.

`subunits` zegt hoeveel decimalen het minor unit heeft (cents):
EUR/USD/GBP → 2
JPY/KRW → 0
BHD/KWD → 3

5 public methods
static cases(): array
static from(string|int $value): static
subunits(): int
symbol(): string
static tryFrom(string|int $value): ?static
Cases: EUR, USD, GBP, JPY

DateRange

Framework\Support\DateRange
final class

Periode tussen twee datums (inclusief). Beide kanten mogen open zijn:

open vóór → from = null (bv. "tot en met 5 mei")
open na → till = null (bv. "vanaf 5 mei")
beide gesloten → range

$r = new DateRange(new DateTimeImmutable('2026-05-01'), new DateTimeImmutable('2026-05-05'));
$r->contains(new DateTimeImmutable('2026-05-03')); // true

Voor de format()-helper geef je de drie woorden mee — geen App-singleton coupling.

__construct(?DateTimeImmutable $from, ?DateTimeImmutable $till)
8 public methods
static between(DateTimeInterface $from, DateTimeInterface $till): self
contains(DateTimeInterface $date): bool
format(string $pattern = 'd MMMM YYYY', string $locale = 'nl', array $words = array ( 0 => 'from', 1 => '–', 2 => 'until', )): string

Format-helper. Vertaalde woorden geef je expliciet mee — voor "vanaf X",
"X t/m Y" en "tot Y". Default English; gebruik bijv. ['vanaf', 't/m', 'tot'].

static from(DateTimeInterface $from): self
isEmpty(): bool
isOpen(): bool
overlaps(self $other): bool
static until(DateTimeInterface $till): self

EmailAddress

Framework\Support\EmailAddress
final class

E-mailadres als value object.

$a = new EmailAddress('info@multiminded.nl');
$b = new EmailAddress('info@multiminded.nl', 'Multiminded');
$c = EmailAddress::parse('Multiminded <info@multiminded.nl>');

(string) $a; // "info@multiminded.nl"
(string) $b; // "Multiminded <info@multiminded.nl>"

Validatie via filter_var; bij ongeldig adres → InvalidArgumentException.
Voor non-throwing parsing: {@see tryParse()}.

__construct(string $email, ?string $name = NULL)
6 public methods
domain(): string

Domein (na @), lowercase.

equals(\EmailAddress $other): bool
localPart(): string

Lokaal deel (vóór @).

static parse(string $input): self

Parse "Naam <email@addr.com>" of "email@addr.com" (kale variant).

static tryParse(string $input): ?self
withName(?string $name): self

Format

Framework\Support\Format
final class

Pure formatter-helpers — getallen, prijzen, datums.

In tegenstelling tot de legacy `Format` + `Utils`-mix:
- geen `\App::getStaticInstance()` voor vertalingen
- geen globale `domain_lng` constante; locale per call
- geen email/phone-validatie hier (zit in `EmailAddress` resp. dedicated VOs)

Range-functies (formatDateRange/formatTimeRange) zijn niet meegekomen — die
leunen zwaar op een Translator. Migreren zodra we PSR-compatibele
vertaalservice hebben.

6 public methods
static date(DateTimeInterface|string $date, string $pattern = 'd MMMM YYYY', string $locale = 'nl'): string

Datum-formatter via IntlDateFormatter.

static float(float $value, int $decimals = 2, bool $compact = true): string

Float NL-stijl. $compact: gehele waarden zonder decimalen, anders trailing zeroes
eruit (`12,50` blijft `12,5`).

static parseFloat(string $value): float

Parse zowel NL-stijl ("1.234,56") als US-stijl ("1234.56") naar float.
Legere of niet-numerieke invoer → 0.0.

static parsePrice(string $price): float

Idem als parseFloat — gehouden voor leesbaarheid op call-site.

static phoneNl(string $value): string

NL-telefoonnummer normaliseren (0612345678 / +31612345678 → +31-612345678).

static price(float $value, int $decimals = 2, string $decimalSep = ',', string $thousandSep = '.', string|bool $shortHand = false): string

Prijs NL-stijl. `$shortHand` vervangt `,00` — true → `,-`, anders je eigen string.

Iban

Framework\Support\Iban
final class

IBAN value object met validatie (mod-97 + landlengte) en formatting.

$iban = new Iban('NL91 ABNA 0417 1643 00');
$iban->compact(); // "NL91ABNA0417164300"
$iban->formatted(); // "NL91 ABNA 0417 1643 00"
$iban->countryCode();// "NL"

__construct(string $iban)
7 public methods
bban(): string

Bank/account-deel — alles na de check digits.

checkDigits(): string
compact(): string

"NL91ABNA0417164300"

countryCode(): string
equals(self $other): bool
formatted(): string

"NL91 ABNA 0417 1643 00" — groepen van 4 tekens.

static tryParse(string $iban): ?self

Inflect

Framework\Support\Inflect
final class

Engelse meervouds-/enkelvoudsregels — origineel:
http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/

Dezelfde regelset als legacy Inflect, gemoderniseerd: strict types,
private const arrays, return-types.

3 public methods
static pluralize(string $word): string
static singularize(string $word): string
static withCount(int $count, string $word): string

"1 item" of "5 items" — handig voor UI.
Voorheen `pluralize_if`; renamed naar `withCount` (leesbaarder bij call-site).

Money

Framework\Support\Money
final class

Money — bedrag in minor units (cents) + currency. Immutable, integer-based.

Money::eur(19.99); // €19.99
Money::fromMinor(1999, EUR); // idem
$a->plus($b); // gooit als currencies verschillen
$a->times(0.21); // BTW-berekening

Geen float-rekenwerk intern — voorkomt 0.1 + 0.2 = 0.30000000000000004 ellende.

__construct(int $minor, \Currency $currency)
17 public methods
compareTo(self $other): int
divide(float $divisor): self
equals(self $other): bool
static eur(float $amount): self
format(string|bool $shortHand = false): string

Pretty-print: "€ 19,99". Gebruikt {@see Format::price} voor NL-stijl.
Voor andere stijlen: gebruik major() en bouw zelf op.

static fromMajor(float $amount, \Currency $currency = \Framework\Support\Currency::EUR): self

Vanuit major units (euro's): 19.99 → 1999 cent EUR. Half-up rounding.

static fromMinor(int $minor, \Currency $currency = \Framework\Support\Currency::EUR): self
isNegative(): bool
isPositive(): bool
isZero(): bool
major(): float
minus(self $other): self
negate(): self
plus(self $other): self
times(float $factor): self
static usd(float $amount): self
static zero(\Currency $currency = \Framework\Support\Currency::EUR): self

PhoneNumber

Framework\Support\PhoneNumber
final class

Telefoonnummer-DTO. Eerste implementatie ondersteunt NL primair (0xx, +31)
en accepteert internationale nummers (+xxx) als pass-through.

$p = PhoneNumber::nl('0612345678'); // → +31612345678
$p->isMobile(); // true (begint met 6)
$p->national(); // "06-12345678"
$p->international(); // "+31 6 12345678"

Voor volledige nummerlogica per land: libphonenumber. Deze klasse is een
lichte VO voor de meest voorkomende NL-cases.

__construct(string $raw, string $defaultCountry = 'NL')
6 public methods
equals(self $other): bool
international(): string

"+31 6 12345678" voor mobiel; anders "+31 NN NNN NN NN" eenvoudig.

isMobile(): bool

Mobiel volgens NL-conventie: dial+31 6XXXXXXXX. Voor andere landen geeft
deze functie false (niet ondersteund).

national(): string

"06-12345678" voor NL, anders e164.

static nl(string $raw): self
static tryParse(string $raw, string $defaultCountry = 'NL'): ?self

TimeRange

Framework\Support\TimeRange
final class

Tijdsduur tussen twee tijdstippen — net als DateRange maar met tijd-pattern.

$r = TimeRange::between('09:00', '17:00');
$r->format('H:mm', 'nl', ['om', 'uur', 'van', 'tot']);

Standaard: "09:00 – 17:00".

__construct(?DateTimeImmutable $from, ?DateTimeImmutable $till)
3 public methods
static between(DateTimeInterface|string $from, DateTimeInterface|string $till): self
duration(): DateInterval
format(string $pattern = 'H:mm', string $locale = 'nl', array $words = array ( 0 => 'at', 1 => '', 2 => 'from', 3 => 'until', )): string

Format zoals legacy `formatTimeRange`. Vier woorden:
[0] "om" (single time)
[1] "uur" (suffix achter de tijd)
[2] "van" (range start)
[3] "tot" (range separator)