eloquent/phpstan-phony

PHPStan configuration for Phony.

Installs: 24 931

Dependents: 19

Suggesters: 0

Stars: 3

Watchers: 2

Forks: 1

Open Issues: 0

Type:phpstan-extension

0.6.0 2019-11-16 09:40 UTC

README

Current version image

Installation

composer require --dev eloquent/phpstan-phony

Usage

  • When using phpstan/extension-installer, no configuration is necessary.
  • Alternatively, an include can be added to the PHPStan configuration:
includes:
  - vendor/eloquent/phpstan-phony/phony.neon

Features

This repo currently supports correct type information for the following Phony mocking use cases:

mock(ClassA::class)->get();
mock([ClassA::class, ClassB::class])->get();
partialMock(ClassA::class)->get();
partialMock([ClassA::class, ClassB::class])->get();
mockBuilder(ClassA::class)->get();
mockBuilder([ClassA::class, ClassB::class])->get();
mockBuilder(ClassA::class)->full();
mockBuilder([ClassA::class, ClassB::class])->full();
mockBuilder(ClassA::class)->partial();
mockBuilder([ClassA::class, ClassB::class])->partial();
mockBuilder(ClassA::class)->partialWith();
mockBuilder([ClassA::class, ClassB::class])->partialWith();

Phony::mock(ClassA::class)->get();
Phony::mock([ClassA::class, ClassB::class])->get();
Phony::partialMock(ClassA::class)->get();
Phony::partialMock([ClassA::class, ClassB::class])->get();
Phony::mockBuilder(ClassA::class)->get();
Phony::mockBuilder([ClassA::class, ClassB::class])->get();
Phony::mockBuilder(ClassA::class)->full();
Phony::mockBuilder([ClassA::class, ClassB::class])->full();
Phony::mockBuilder(ClassA::class)->partial();
Phony::mockBuilder([ClassA::class, ClassB::class])->partial();
Phony::mockBuilder(ClassA::class)->partialWith();
Phony::mockBuilder([ClassA::class, ClassB::class])->partialWith();

mock(ClassA::class)->methodA;
onStatic(mock(ClassA::class))->staticMethodA;

License

For the full copyright and license information, please view the LICENSE file.