proget-hq / phpstan-phpspec
PhpSpec extension for PHPStan
Installs: 30 092
Dependents: 1
Suggesters: 0
Security: 0
Stars: 20
Watchers: 2
Forks: 9
Open Issues: 2
pkg:composer/proget-hq/phpstan-phpspec
Requires
- php: ^7.1
- nikic/php-parser: ^4.1
- phpspec/phpspec: ^6.0
- phpstan/phpstan: ^0.11.6
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.13
- phpstan/phpstan-phpunit: ^0.11
- phpunit/phpunit: ^7.0
- symfony/var-dumper: ^4.2
This package is auto-updated.
Last update: 2025-10-14 15:52:34 UTC
README
What does it do?
- Currently compatible with original specs from
PhpSpecitself - Check if custom matcher exist in given spec class
- support fot
getMatchersmethod
- support fot
- Provides correct return type for
Collaboratorin spec methodswill*methods- support for array return type (check if array item has correct type)
- Allow to user
PropehcyasCollaboratorargumentsArgument::cetera(),Argument::any()
- Provides correct attributes for
Collaborator - Provides correct methods for
ObjectBehavior:should*methodsduring*methodsbeConstructedWith,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
getWrappedObjectmethod - Support
ObjectState Matcherand check if appropriate methods exists
Compatibility
| PHPStan version | PhpSpec version | PhpSpec extension version |
|---|---|---|
| ^0.11.6 | ^6.0 | 0.3.x |
| ^0.11.6 | ^5.1 | 0.2.x |
| ^0.10.7 | ^5.1 | 0.1.x |
Installation
composer require --dev proget-hq/phpstan-phpspec
Configuration
Put this into your phpstan.neon config:
includes: - vendor/proget-hq/phpstan-phpspec/extension.neon parameters: specDir: 'spec/'