kphoen/rusty
Rusty brings Rust-inspired Result and Option types to PHP and Laravel, enabling explicit error handling and nullable values without exceptions or scattered null checks. Fluent helpers make safer, more expressive code easy to write.
Architecture fit. Rusty implements the "documentation as tests" pattern (Rust-style doctests) for PHP: it extracts executable code samples from docblocks and runs them as part of the test suite. Architecturally this is a clean, orthogonal fit for a Laravel codebase — it lives entirely at the test layer, adds no production runtime dependency, and provides a CI guardrail against documentation drift. That property is genuinely valuable for SDK-style packages, service classes with usage examples, and onboarding-oriented docs. However, the package itself is archived, 47 stars, 0 dependents — it is effectively a single-author reference implementation, not an ecosystem-standard tool. The opportunity score (2.38) reflects that the pattern is useful while the package is low-value as a dependency.
Integration feasibility. Low-to-moderate as-is, moderate as a fork. Rusty is expected to integrate through a PHPUnit test case or suite that you point at source directories; the integration surface is small (test harness + docblock parser), which makes a fork tractable. But any Laravel 10/11 codebase on PHP 8.2+ with PHPUnit 10/11 will almost certainly require patching: PHPUnit's extension/listener APIs, test-suite configuration, and attribute-based metadata have all changed since this package's active period.
Technical risk. High:
phpdocumentor/reflection-docblock and related packages; we inherit their CVE exposure with no upgrade path from the author.Key questions.
TestCase, suite, listener, or extension? This determines fork cost.phpstan/phpstan-doctest, or a generated-test approach)?Stack fit. Conceptually compatible with Laravel's default PHPUnit setup, but written in a pre-Pest, pre-PHPUnit-10 era. Pest-based projects would need an adapter or a bridge test case. No framework coupling is an advantage — this is not a Laravel-specific package and does not conflict with the framework's service container or bootstrap.
Migration path. Three viable routes, in order of preference:
phpstan/phpstan-doctest if PHPStan is already in the stack) — lowest total cost of ownership, no fork.Compatibility. Assume breakage on PHPUnit 10+ (metadata, lifecycle, result APIs) and on PHP 8.x (typed properties, deprecations in older parsing code). The docblock parser is the most version-sensitive component.
Sequencing.
Maintenance. The dominant cost. Archived software is our software: budget roughly 3–5 engineer-days for initial fork remediation and 1–2 days per quarter for PHP/PHPUnit upgrades. This must be an explicitly funded line item, not absorbed silently by the platform team.
Support. None from upstream. Internal expertise will be concentrated in one or two engineers — a key-person risk. Document the fork's design and upgrade procedure from day one.
Scaling. Docblock parsing is fast per file but scales linearly with source count; on a large monorepo this becomes a meaningful addition to CI wall-clock and should run as a separate, parallelizable CI job rather than inside the unit-test suite. Per-example process isolation trades speed for reliability — recommend isolation for anything touching the container, database, or clock.
Failure modes.
Ramp-up. Low for documentation authors — writing examples is intuitive and the feedback loop is fast. Medium-to-high for platform owners, who must understand the extraction and execution model well enough to debug edge cases and own upgrades. Expect half a day of onboarding for contributors and two to three days for the owning engineer.
Recommendation. Do not adopt the archived package as a direct dependency. Treat the pattern as worth evaluating: run the discovery spike, prefer a maintained alternative, and only fork Rusty if documentation accuracy is an explicit quality goal with a named owner and a funded maintenance line.
How can I help you explore Laravel packages today?