phpstan/phpstan-mockery 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

phpstan/phpstan-mockery

Composer 安装命令:

composer require --dev phpstan/phpstan-mockery

包简介

PHPStan Mockery extension

README 文档

README

Build Latest Stable Version License

This extension provides the following features:

  • Mockery::mock(), Mockery::spy(), and Mockery::namedMock() return an intersection type (e.g. Foo&MockInterface) so that the mock can be used as both the mocked class and a mock object. See the detailed explanation of intersection types.
  • Interprets Foo|\Mockery\MockInterface in phpDoc so that it results in an intersection type instead of a union type. This can be disabled by setting the mockery.convertUnionToIntersectionType parameter to false.
  • shouldReceive(), shouldNotReceive(), shouldHaveReceived(), shouldNotHaveReceived(), allows(), and expects() methods are understood on mock objects.
  • makePartial() and shouldAllowMockingProtectedMethods() return static, preserving the intersection type for chained calls.
  • Alias (alias:) and overload (overload:) mock prefixes are handled.
  • Partial mock syntax (ClassName[methodName]) is supported.
  • Multiple interfaces passed as comma-separated strings or as separate arguments are resolved.
  • Constructor argument arrays passed to mock() are handled correctly.

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

统计信息

  • 总下载量: 26.52M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 103
  • 点击次数: 9
  • 依赖项目数: 752
  • 推荐数: 2

GitHub 信息

  • Stars: 103
  • Watchers: 3
  • Forks: 24
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固