Skip to content

phpstan/phpstan-mockery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
Dec 19, 2020
Dec 12, 2020
Jul 21, 2020
Feb 5, 2021
Feb 5, 2021
Jul 26, 2018
Apr 23, 2020
Jul 26, 2018
Dec 12, 2020
Dec 12, 2020
Dec 12, 2020
Jul 21, 2020
Dec 12, 2020
Nov 11, 2019

Repository files navigation

PHPStan Mockery extension

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