{"repo":"phpstan/phpstan-mockery","free":true,"listed":false,"github":"https://github.com/phpstan/phpstan-mockery","clone":"git clone https://github.com/phpstan/phpstan-mockery.git","description":"PHPStan extension for Mockery","language":"PHP","stars":107,"topics":["phpstan","static-code-analysis","static-analysis","php","php7","mockery"],"license":"MIT","category":"dev-tools","readme_excerpt":"PHPStan Mockery extension PHPStan Mockery 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: 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:","default_branch":null,"files":null,"tree":[],"storefront":"/r/phpstan","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/phpstan/phpstan-mockery/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}