1. Go to this page and download the library: Download wwwision/types-glossary library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wwwision / types-glossary example snippets
#[StringBased(minLength: 1, maxLength: 200)]
final class Name {
private function __construct(public readonly string $value) {}
}
#[IntegerBased(minimum: 1, maximum: 130)]
final class Age {
private function __construct(public readonly int $value) {}
}
final class Contact {
public function __construct(
public readonly Name $name,
public readonly Age $age,
) {}
}
#[ListBased(itemClassName: Contact::class, minCount: 1, maxCount: 5)]
final class Contacts {
private function __construct(private readonly array $contacts) {}
}