PHPackages                             prophesizer/prophesizer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. prophesizer/prophesizer

ActiveLibrary[Testing &amp; Quality](/categories/testing)

prophesizer/prophesizer
=======================

Generates prophecy double stubs

09[12 issues](https://github.com/lukashin/prophesizer/issues)PHP

Since Aug 19Pushed 8y agoCompare

[ Source](https://github.com/lukashin/prophesizer)[ Packagist](https://packagist.org/packages/prophesizer/prophesizer)[ RSS](/packages/prophesizer-prophesizer/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Prophesizer
-----------

[](#prophesizer)

Generates a [Prophecy](https://github.com/phpspec/prophecy)[Dummy](https://github.com/phpspec/prophecy#dummies) for class/interface you want to prophesize

Prophesizer inspects `@docComment` blocks in your code and creates method prophecies according to specified `@return`, `@throws` and `@param` docTags

`@return` and `@throws` samples generated in `->will(){...}` closure

`@param int $id` used to check parameters with `Argument::type('int')` etc.

Example
-------

[](#example)

```
public function someUnitTest()
{
    $service = $this->prophesize('Service\SomeService'); ///
}

```

Press `Ctrl+S` and line with `///` will be transformed into

```
public function someUnitTest()
{
    // $service = $this->prophesize('Service\SomeService');
    $service = $this->getSomeServiceDouble(); // todo: edit predictions!
}

```

```
/**
 * @return \Service\SomeService
 */
private function getSomeServiceDouble()
{
    $someServiceProphecy = $this->prophesize('Service\SomeService');

    /** @noinspection PhpUndefinedMethodInspection */
    $someServiceProphecy
        ->createSomething(
            Argument::type('int'),
            Argument::type('string'),
            Argument::allOf(Argument::type('DateTime'), Argument::type('null'))
        )
        ->will(function (array $args) {
            // todo: modify generated method double
            // throw new \SomeService\Exception('Thrown in SomeService::createSomething()');
            // return 999;
        })
        ->shouldBeCalled();
        //->shouldNotBeCalled();

    return $someServiceProphecy->reveal();
}

```

Why?
----

[](#why)

I'm tired of manual Dummies writing

Installation
------------

[](#installation)

`composer require prophesizer/prophesizer`

**PhpStorm** Settings / Tools / File Watchers / `+`

```
-Watcher-
Name: prophesizer

-Options-
Show console : Error
[ ] Immediate file synchronization

-Watcher Settings-
File type    : PHP
Scope        : VCS / Changed Files
Program      : $ProjectFileDir$/vendor/bin/prophesizer
Arguments    : $FilePath$ $ProjectFileDir$
[x] Create output file from stdout

```

[PhpStorm / Edit watcher dialog](https://www.jetbrains.com/help/phpstorm/2016.2/new-watcher-dialog.html)

[![prophesizer-watcher-setup](https://raw.githubusercontent.com/lukashin/prophesizer/master/resources/images/prophesizer-watcher-setup.png)](https://raw.githubusercontent.com/lukashin/prophesizer/master/resources/images/prophesizer-watcher-setup.png)

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5064002?v=4)[lukashin](/maintainers/lukashin)[@lukashin](https://github.com/lukashin)

---

Top Contributors

[![lukashin](https://avatars.githubusercontent.com/u/5064002?v=4)](https://github.com/lukashin "lukashin (12 commits)")

### Embed Badge

![Health badge](/badges/prophesizer-prophesizer/health.svg)

```
[![Health](https://phpackages.com/badges/prophesizer-prophesizer/health.svg)](https://phpackages.com/packages/prophesizer-prophesizer)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14228.7M341](/packages/dms-phpunit-arraysubset-asserts)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
