PHPackages                             proget-hq/phpstan-phpspec - 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. proget-hq/phpstan-phpspec

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

proget-hq/phpstan-phpspec
=========================

PhpSpec extension for PHPStan

0.3.0(5y ago)2130.6k↓76.7%8[2 issues](https://github.com/proget-hq/phpstan-phpspec/issues)MITPHPPHP ^7.1

Since Dec 29Pushed 4y ago2 watchersCompare

[ Source](https://github.com/proget-hq/phpstan-phpspec)[ Packagist](https://packagist.org/packages/proget-hq/phpstan-phpspec)[ RSS](/packages/proget-hq-phpstan-phpspec/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (5)Dependencies (7)Versions (7)Used By (0)

PhpSpec extension for PHPStan
=============================

[](#phpspec-extension-for-phpstan)

[![Minimum PHP Version](https://camo.githubusercontent.com/824c5c4ccb56537db3b3b53bb43d7b8edc6286f3b3d1705525e0821dfd22d27e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e312d3838393242462e737667)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/f3bebec708118656adff32a7f5da6517e62e17405fee829d363424b3292aa7dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f6765742d68712f7068707374616e2d706870737065632e737667)](https://packagist.org/packages/proget-hq/phpstan-phpspec)[![Build Status](https://camo.githubusercontent.com/4828efc850adfb2da137a624c1e4cba61e653463a727f9201587d118c4ed41c2/68747470733a2f2f7472617669732d63692e6f72672f70726f6765742d68712f7068707374616e2d706870737065632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/proget-hq/phpstan-phpspec)[![Total Downloads](https://camo.githubusercontent.com/f9580e75d924d9f9b2427fba00fa56b7a77760fbbba2174f92dc930d8555f25d/68747470733a2f2f706f7365722e707567782e6f72672f70726f6765742d68712f7068707374616e2d706870737065632f646f776e6c6f6164732e737667)](https://packagist.org/packages/proget-hq/phpstan-phpspec)[![License](https://camo.githubusercontent.com/32cbed6c75a72bb2d31daa60796329a25ac956080aed5f7bd33fd8c4d2c8d074/68747470733a2f2f706f7365722e707567782e6f72672f70726f6765742d68712f7068707374616e2d706870737065632f6c6963656e73652e737667)](https://packagist.org/packages/proget-hq/phpstan-phpspec)

What does it do?
----------------

[](#what-does-it-do)

- Currently compatible with original specs from `PhpSpec` itself
- Check if custom matcher exist in given spec class
    - support fot `getMatchers` method
- Provides correct return type for `Collaborator` in spec methods
    - `will*` methods
    - support for array return type (check if array item has correct type)
- Allow to user `Propehcy` as `Collaborator` arguments
    - `Argument::cetera()`, `Argument::any()`
- Provides correct attributes for `Collaborator`
- Provides correct methods for `ObjectBehavior`:
    - `should*` methods
    - `during*` methods
    - `beConstructedWith`, `beConstructedThrough`, `beAnInstanceOf`
    - search original spec class (subject) and check if methods exists
- Provides correct attributes for `ObjectBehavior`:
    - public attributes
    - static properties (with `$this->CONSTANT_NAME`)
- Provides correct class for `getWrappedObject` method
- Support `ObjectState Matcher` and check if appropriate methods exists

Compatibility
-------------

[](#compatibility)

PHPStan versionPhpSpec versionPhpSpec extension version^0.11.6^6.00.3.x^0.11.6^5.10.2.x^0.10.7^5.10.1.xInstallation
------------

[](#installation)

```
composer require --dev proget-hq/phpstan-phpspec
```

Configuration
-------------

[](#configuration)

Put this into your `phpstan.neon` config:

```
includes:
	- vendor/proget-hq/phpstan-phpspec/extension.neon
parameters:
    specDir: 'spec/'
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.7% 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.

###  Release Activity

Cadence

Every ~183 days

Total

5

Last Release

2003d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d00e1e73a4ff379162b943421469055929a95e7a6ce4c3808976dcc1fa28f4f?d=identicon)[akondas](/maintainers/akondas)

![](https://avatars.githubusercontent.com/u/57528542?v=4)[Marcin Michalski](/maintainers/marmichalski)[@marmichalski](https://github.com/marmichalski)

---

Top Contributors

[![akondas](https://avatars.githubusercontent.com/u/8239917?v=4)](https://github.com/akondas "akondas (23 commits)")[![Kocal](https://avatars.githubusercontent.com/u/2103975?v=4)](https://github.com/Kocal "Kocal (10 commits)")[![ondrejmirtes](https://avatars.githubusercontent.com/u/104888?v=4)](https://github.com/ondrejmirtes "ondrejmirtes (1 commits)")[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (1 commits)")

---

Tags

phpspecphpstanphpstan-extensionstatic-analysis

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/proget-hq-phpstan-phpspec/health.svg)

```
[![Health](https://phpackages.com/badges/proget-hq-phpstan-phpspec/health.svg)](https://phpackages.com/packages/proget-hq-phpstan-phpspec)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.6k](/packages/larastan-larastan)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k100.2M2.1k](/packages/behat-behat)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79473.3M2.0k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67270.7M1.3k](/packages/phpstan-phpstan-doctrine)[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9184.1M24](/packages/phparkitect-phparkitect)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

4813.1M82](/packages/shipmonk-dead-code-detector)

PHPackages © 2026

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