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)2030.2k↓72%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 3d 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 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity36

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

1957d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/e724eb6565c2f9abb7fa9e32ff52eec6854f6f963a274a09ffc55f9603cf43ce?d=identicon)[marmichalski](/maintainers/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

[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[larastan/larastan

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

6.4k43.5M5.2k](/packages/larastan-larastan)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

78268.9M1.5k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

66466.6M1.1k](/packages/phpstan-phpstan-doctrine)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)

PHPackages © 2026

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