This package is no longer maintained. See this statement for more info.
composer require --dev eloquent/phpstan-phony
- 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
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;
For the full copyright and license information, please view the LICENSE file.