Weave Code
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

Plugin Mockery Laravel Package

psalm/plugin-mockery

Adds Psalm static analysis support for the Mockery testing framework. Improves type inference and understanding of mocked objects and expectations in PHPUnit-style tests. Install via Composer and enable with psalm-plugin for better mock-related diagnostics.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: The plugin seamlessly extends Psalm's static analysis to handle Mockery's dynamic mock objects, resolving a critical gap in type inference for runtime-generated classes. It integrates natively with Psalm's plugin system without requiring custom tooling, making it ideal for projects using both tools. The design aligns with Psalm's extensibility model and Mockery's API patterns.

Integration feasibility: Straightforward via Composer and psalm-plugin enable command. Requires existing Psalm and Mockery usage—no production code changes needed. Compatibility must be validated against specific Psalm (v5-v7) and Mockery (v1+) versions. Projects without Psalm would need to adopt it first, but the plugin itself has no external dependencies beyond these core tools.

Technical risk: Low adoption (0 dependents, 10 stars) and future-dated release (2025-03-20) raise maintenance concerns. Limited community activity increases risk of unresolved bugs during Psalm/Mockery updates. Potential for false positives/negatives if edge cases aren't covered. Plugin stability depends on upstream changes to Psalm/Mockery.

Key questions: Is maintainership active despite low adoption metrics? How does it handle complex Mockery patterns like Mockery::on() matchers or constructor-arg mocks? Does it fully support all Mockery 1.x features used in our test suite? What's the rollback plan if CI fails during analysis?

Integration Approach

Stack fit: Optimized for Laravel/PHP projects using Psalm for static analysis and Mockery for test doubles. Enhances type safety for test code without affecting production logic or other testing frameworks (PHPUnit, Pest). Works out-of-the-box with existing test suites—no framework-specific configuration needed.

Migration path: Minimal effort for existing Psalm/Mockery users: install dependency, enable plugin, and re-run Psalm. For new Psalm adopters: first configure Psalm baseline for production code, then add this plugin for test-specific type inference. No breaking changes expected in test logic.

Compatibility: Requires PHP 8.1+, Mockery ≥1.0, and Psalm v5-v7. Must align with project's current versions—check composer.json constraints (e.g., vimeo/psalm: "^5.0 || ^6 || ^7"). Avoid if using Psalm <5.0 or alternative mocking frameworks (PHPUnit native mocks, Prophecy).

Sequencing: 1) Verify current Psalm and Mockery versions meet requirements; 2) Install via Composer; 3) Enable plugin; 4) Run Psalm with

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport