Skip to content

proget-hq/phpstan-phpspec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3cc6b98 Â· Dec 30, 2018

History

20 Commits
Dec 30, 2018
Dec 30, 2018
Dec 30, 2018
Dec 19, 2018
Dec 19, 2018
Dec 23, 2018
Dec 19, 2018
Dec 30, 2018
Dec 19, 2018
Dec 29, 2018
Dec 30, 2018
Dec 30, 2018
Dec 29, 2018
Dec 19, 2018

Repository files navigation

PhpSpec extension for PHPStan

Minimum PHP Version Latest Stable Version Build Status Total Downloads License

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

Compatibility

PHPStan version PhpSpec extension version
0.10.7 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/'