ciaranmcnulty/phpspec-typehintedmethods
PhpSpec extension that generates typehinted methods for your collaborators, so spec-generated stubs and mocks include proper parameter and return types. Keeps specs clean while producing type-safe, IDE-friendly code.
--dev) is cheaper than building only if the package still works on our PHP version; otherwise a PHP-CS-Fixer/Rector post-step or a ~100-line in-house extension is the cheaper path.static, never, enums, and readonly — validate behavior on PHP 8.x before committing.To executives: A free, MIT-licensed developer-experience add-on that keeps phpspec-generated test stubs consistent with our typed-code standards, so engineers spend less time hand-editing boilerplate. Cost is near zero — a dev-only dependency with no runtime or infrastructure footprint. The material caveat is maintenance: last release was 2018 with a very small user base, so treat it as a "vendor-if-needed" utility rather than a platform commitment. It is only relevant if we're already standardized on phpspec.
To engineering: One extension class that teaches phpspec's code generator to emit parameter and return type hints derived from the spec. Adoption is composer require --dev plus registration in phpspec.yml. Before merging, confirm PHP 8.x compatibility and assume we may need to carry patches. If we're not on phpspec, skip it entirely and handle type-hint cleanup with PHP-CS-Fixer/Rector in a PHPUnit or Pest workflow.
How can I help you explore Laravel packages today?