- What is tdn/php-types used for?
- It boxes PHP scalars into immutable value objects such as Int, String, Float, Bool, and Arr with validation and fluent accessors. It is intended for primitive-obsession reduction and clearer domain code, not as a full Laravel integration. It provides no service provider, facade, config, or Eloquent casts.
- Does tdn/php-types work with Laravel 10 or 11?
- There is no framework coupling, so there is nothing to register in config/app.php or bootstrap/providers.php. That also means no published Laravel casts, validation rules, request hydration, or API resource support. Every Laravel integration point must be hand-written, and compatibility with Laravel 10 or 11 on PHP 8.1 to 8.3 is unverified and likely broken.
- How do I install tdn/php-types with Composer?
- It is Composer-installable with PSR-4 autoloading and has no transitive dependency tree to audit. With only a single 2015 tag and no published SemVer history, constraint resolution will likely require dev-master pinning. Do not add it to composer.json if the license is unresolved; vendor-by-copy selectively after legal review.
- Is tdn/php-types compatible with PHP 8.1, 8.2, or 8.3?
- Compatibility is unverified and plausibly broken. The classes are named String, Int, Float, and Bool, which are reserved words in PHP 7+ and fatal in PHP 8.x. That is a go/no-go on the artifact itself. No PHP-version fixes exist because the project is archived.
- Does tdn/php-types have a license I can use commercially?
- GitHub cannot detect a declared license, reporting NOASSERTION, so commercial distribution or inclusion in a proprietary product is a legal unknown. There is no explicit OSI license to review. Obtain counsel sign-off before copying any code. If the license does not clear, reimplement the pattern from scratch.
- Is tdn/php-types actively maintained?
- No. There is a single 2015 tag, no CI badge, no coverage report, and no documentation site. The repository is archived with no maintainer, so there is no security response path or CVE triage. You become the maintainer by default.
- Can I use tdn/php-types value objects with Eloquent casts or JSON serialization?
- Boxed scalars break json_encode, Eloquent attribute casting, session and queue payloads, and Blade prop expectations unless you write converters. No published casts or factories are included. You must hand-write every conversion layer and implement Stringable or JsonSerializable yourself.
- What are alternatives to tdn/php-types for type safety in Laravel?
- Native PHP 7+ scalar types, PHP 8.1 readonly properties, and native enums cover about 90% of the value with zero dependency risk. For specific needs, consider webmozart/assert, ramsey/uuid, brick/money, or native DTOs. Writing two or three wrapper classes in-house is likely under one day each.
- How do I test or validate data with tdn/php-types?
- The library provides validation inside its immutable value objects, but there are no Laravel validation rules, factories, or testing utilities included. With no CI badge, coverage report, or documentation, integration knowledge must be reverse-engineered from source. You will need to write your own tests and converters.
- Should I install tdn/php-types in a production Laravel app?
- Generally no. It is poor as a dependency because it has no Laravel touchpoints, unresolved licensing, archived maintenance, PHP 8 fatal risks, and serialization friction. Treat it as a pattern reference and copy only the two or three wrapper classes you genuinely need into your own namespace. Rewrite them for PHP 8.2 with final readonly typed properties and Stringable or JsonSerializable implementations.