Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpstan Phony Laravel Package

eloquent/phpstan-phony

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enhanced Test Reliability: Integrate static analysis into the testing pipeline to catch type-related issues in Phony mocks early, reducing runtime errors in unit tests.
  • Developer Productivity: Reduce manual debugging by leveraging PHPStan’s type-checking for Phony mocks, allowing developers to focus on business logic rather than mocking edge cases.
  • Build vs. Buy Decision: Avoid reinventing static analysis rules for Phony mocks by adopting this pre-built configuration, saving engineering time and effort.
  • Roadmap for Test Quality: Align with a broader initiative to improve code quality by integrating static analysis into CI/CD pipelines, even for legacy or less-maintained packages.
  • Use Cases:
    • Teams using Phony for mocking in Laravel/PHP projects.
    • Projects where PHPStan is already adopted for static analysis.
    • Development teams prioritizing type safety in unit tests.

When to Consider This Package

  • Adopt if:

    • Your team uses Phony for mocking and PHPStan for static analysis.
    • You’re already leveraging PHPStan Extension Installer (simplifies integration).
    • Your project supports PHP 7.2+ and PHPStan 0.12.x or 1.x (latest versions).
    • You want to reduce false positives in tests by validating mock types statically.
  • Look elsewhere if:

    • Your project does not use Phony (irrelevant).
    • You’re not using PHPStan (no static analysis benefit).
    • You require active maintenance (package is archived; consider alternatives like phpstan/phpstan-mock-objects).
    • Your team relies on PHP 7.1 or older (dropped support).
    • You need custom mocking rules beyond Phony’s scope (e.g., Laravel-specific mocks).

How to Pitch It (Stakeholders)

For Executives: "This package enables our team to catch type-related bugs in unit tests before they reach production, improving test reliability and reducing debugging time. By integrating PHPStan’s static analysis for Phony mocks, we can enforce consistency in our test suite without additional engineering overhead. It’s a low-risk, high-reward upgrade to our testing pipeline, especially if we’re already using PHPStan."

For Engineering/Dev Teams: *"This is a zero-maintenance way to add type safety to Phony mocks. If we’re using PHPStan and Phony, this package:

  • Reduces flaky tests by validating mock types statically.
  • Works out-of-the-box with PHPStan Extension Installer (just composer require).
  • Supports modern PHP/PHPStan (7.2+ and 0.12.x/1.x). Downside: It’s archived, but since it’s config-only, we can fork it if needed. Worth the trade-off for the immediate quality boost."*

For PMs: *"This is a quick win for test quality with minimal effort. If we’re investing in PHPStan or Phony, this is a free layer of safety. Prioritize if:

  1. Tests are a bottleneck (flakiness, debugging).
  2. We’re adopting PHPStan or want to standardize static analysis.
  3. We’re using Phony and want to future-proof against type issues. Alternative: If we’re not using Phony, skip this—focus on other test infrastructure improvements."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log