定制 phpstan/phpstan-mockery 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpstan/phpstan-mockery

最新稳定版本:2.0.0

Composer 安装命令:

composer require phpstan/phpstan-mockery

包简介

PHPStan Mockery extension

README 文档

README

Build Latest Stable Version License

This extension provides the following features:

  • Interprets Foo|\Mockery\MockInterface in phpDoc so that it results in an intersection type instead of a union type.
  • Mockery::mock() and Mockery::spy() return an intersection type (see the detailed explanation of intersection types) so that the returned object can be used as both the mock object and the mocked class object.
  • shouldReceive(), allows() and expects() methods can be called on the mock object and they work as expected.

Installation

To use this extension, require it in Composer:

composer require --dev phpstan/phpstan-mockery

If you also install phpstan/extension-installer then you're all set!

Manual installation

If you don't want to use phpstan/extension-installer, include extension.neon in your project's PHPStan config:

includes:
    - vendor/phpstan/phpstan-mockery/extension.neon

统计信息

  • 总下载量: 21.02M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 97
  • 点击次数: 1
  • 依赖项目数: 686
  • 推荐数: 2

GitHub 信息

  • Stars: 97
  • Watchers: 3
  • Forks: 20
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04