Auto-gegenereerd via Reflection — blijft altijd in sync met src/.
Address
Framework\Support\AddressPostadres 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): boollines(): arrayPostadres opgesplitst in regels, klaar voor weergave.
withHouseNumber(string $number, ?string $suffix = NULL): selfColor
Framework\Support\ColorKleur 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): boolstatic fromHex(string $hex, float $alpha = 1.0): selfAccepteert "#abc", "#aabbcc", "abc", "aabbcc", "#aabbccdd" (RGBA hex).
static fromRgb(int $r, int $g, int $b, float $alpha = 1.0): selfisLight(): boolQuick check: is een witte- of zwarte voorgrond beter?
luminance(): floatRelatieve luminantie volgens WCAG (0-1).
toHex(bool $withAlpha = false): stringtoRgb(): stringtoRgba(): stringstatic tryParse(string $input): ?selfwithAlpha(float $alpha): selfCurrency
Framework\Support\CurrencyISO-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(): arraystatic from(string|int $value): staticsubunits(): intsymbol(): stringstatic tryFrom(string|int $value): ?staticEUR, USD, GBP, JPYDateRange
Framework\Support\DateRangePeriode 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): selfcontains(DateTimeInterface $date): boolformat(string $pattern = 'd MMMM YYYY', string $locale = 'nl', array $words = array (
0 => 'from',
1 => '–',
2 => 'until',
)): stringFormat-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): selfisEmpty(): boolisOpen(): booloverlaps(self $other): boolstatic until(DateTimeInterface $till): selfEmailAddress
Framework\Support\EmailAddressE-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(): stringDomein (na @), lowercase.
equals(\EmailAddress $other): boollocalPart(): stringLokaal deel (vóór @).
static parse(string $input): selfParse "Naam <email@addr.com>" of "email@addr.com" (kale variant).
static tryParse(string $input): ?selfwithName(?string $name): selfFormat
Framework\Support\FormatPure 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'): stringDatum-formatter via IntlDateFormatter.
static float(float $value, int $decimals = 2, bool $compact = true): stringFloat NL-stijl. $compact: gehele waarden zonder decimalen, anders trailing zeroes
eruit (`12,50` blijft `12,5`).
static parseFloat(string $value): floatParse zowel NL-stijl ("1.234,56") als US-stijl ("1234.56") naar float.
Legere of niet-numerieke invoer → 0.0.
static parsePrice(string $price): floatIdem als parseFloat — gehouden voor leesbaarheid op call-site.
static phoneNl(string $value): stringNL-telefoonnummer normaliseren (0612345678 / +31612345678 → +31-612345678).
static price(float $value, int $decimals = 2, string $decimalSep = ',', string $thousandSep = '.', string|bool $shortHand = false): stringPrijs NL-stijl. `$shortHand` vervangt `,00` — true → `,-`, anders je eigen string.
Iban
Framework\Support\IbanIBAN 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(): stringBank/account-deel — alles na de check digits.
checkDigits(): stringcompact(): string"NL91ABNA0417164300"
countryCode(): stringequals(self $other): boolformatted(): string"NL91 ABNA 0417 1643 00" — groepen van 4 tekens.
static tryParse(string $iban): ?selfInflect
Framework\Support\InflectEngelse 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): stringstatic singularize(string $word): stringstatic 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\MoneyMoney — 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): intdivide(float $divisor): selfequals(self $other): boolstatic eur(float $amount): selfformat(string|bool $shortHand = false): stringPretty-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): selfVanuit major units (euro's): 19.99 → 1999 cent EUR. Half-up rounding.
static fromMinor(int $minor, \Currency $currency = \Framework\Support\Currency::EUR): selfisNegative(): boolisPositive(): boolisZero(): boolmajor(): floatminus(self $other): selfnegate(): selfplus(self $other): selftimes(float $factor): selfstatic usd(float $amount): selfstatic zero(\Currency $currency = \Framework\Support\Currency::EUR): selfPhoneNumber
Framework\Support\PhoneNumberTelefoonnummer-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): boolinternational(): string"+31 6 12345678" voor mobiel; anders "+31 NN NNN NN NN" eenvoudig.
isMobile(): boolMobiel 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): selfstatic tryParse(string $raw, string $defaultCountry = 'NL'): ?selfTimeRange
Framework\Support\TimeRangeTijdsduur 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): selfduration(): DateIntervalformat(string $pattern = 'H:mm', string $locale = 'nl', array $words = array (
0 => 'at',
1 => '',
2 => 'from',
3 => 'until',
)): stringFormat zoals legacy `formatTimeRange`. Vier woorden:
[0] "om" (single time)
[1] "uur" (suffix achter de tijd)
[2] "van" (range start)
[3] "tot" (range separator)