eloquent/phpstan-phony

PHPStan configuration for Phony.

Installs: 39 696

Dependents: 22

Suggesters: 0

Security: 0

Stars: 6

Watchers: 2

Forks: 2

Open Issues: 0

Type:phpstan-extension

0.7.0 2020-01-05 23:13 UTC

This package is auto-updated.

Last update: 2020-07-06 01:52:16 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.