Changelog
All notable changes to this project will be documented in this file.
0.12.0
- Remove deprecated selector modifiers
- Bump minimum PHP version to 8.1
- Bump minimum PHPStan version to 2.1
- Add
ShouldBeEnumandShouldNotBeEnumassertions
0.11.10
- Fix
ShouldHaveOnlyOnePublicMethodNamedassertion
0.11.9
- Fix
ShouldBeNamedassertion - Add
isStandardClassselector
0.11.8
- Add PHP 8.3 missing built-in classes
- Catch instanceof in dependency rules
0.11.7
- Add
withFilepathselector - Rollback param name for
ShouldBeNamedassertion
0.11.6
- Add missing rule identifier to Declaration assertions
- Fix support for regex in
ShouldHaveOnlyOnePublicMethodNamed - Add support for attribute arguments in
AppliesAttributeassertion
0.11.5
- Add
ShouldBeInvokableassertion - Fix incorrect param name for
ShouldBeNamedassertion
0.11.4
- Add
ShouldHaveOnlyPublicMethodNamedassertion - Fix run on previous PHP versions
0.11.3
- Fix error with getNativeReflection in latest PHPStan versions
- Catch included traits in dependency assertions
0.11.2
- Add
AllOf()selector modifier - Add
AnyOf()selector modifier - Add
AtLeastCountOf()selector modifier - Add
AtMostCountOf()selector modifier - Add
NoneOf()selector modifier - Add
OneOf()selector modifier - Deprecate
AND()selector modifier
0.11.1
- Add support for PHP 8.4
- Manually check built-in classes to ignore them
0.11.0
- Add support for PHPStan 2.x
- Drop support for PHPStan 1.x (breaks BC)
- Use namespaced names on shouldBeNamed assertion (breaks BC)
- Catch all attributes in dependency assertions
- Sanitize rule names to match PHPStan identifier pattern (breaks BC)
- Remove deprecated selectors (breaks BC)
- Add PHPStan identifiers from rule names
0.10.20
- Fix parent interfaces not recognized as extended.
0.10.19
- Add
IsTraitandIsNotTraitselectors. - Add
IsException,IsError, andIsThrowableselectors.
0.10.18
- Add
shouldNotExist()assertion.
0.10.17
- Add the ability to define multiple Rules in the same test function.
0.10.16
- Fix template names getting resolved as FQCNs in throws docs.
0.10.15
- Add
shouldNotBeReadonlyassertion. - Fix return types when building declaration rules with tips.
0.10.14
- Add
shouldInclude()andshouldNotIncludeassertions. - Detect catch blocks in dependency assertions.
- Fix shouldBeNamed assertion not functioning on second run.
0.10.13
- Fix namespace selector matching similar namespaces.
0.10.12
- Add
shouldBeNamed()assertion. - Add
shouldBeInterface()assertion.
0.10.11
- Add
#[TestRule]attribute to mark test's methods as rules. - Add
shouldApplyAttribute()assertion. - Deprecate
hasAttribute()selector in favor ofappliesAttribute(). - Allow extending test files.
0.10.10
- Add
shouldOnlyHaveOnePublicMethod()assertion. - Fix return type of target excludes builder step.
0.10.9
- Add
hasAttribute()selector. - Deprecate
namespace()selector in favor ofinNamespace(). - Deprecate
interface()selector in favor ofisInterface(). - Deprecate
abstract()selector in favor ofisAbstract(). - Deprecate
final()selector in favor ofisFinal(). - Deprecate
readonly()selector in favor ofisReadonly(). - Deprecate
enum()selector in favor ofisEnum(). - Deprecate
attribute()selector in favor ofisAttribute().
0.10.8
- Fix
Should-rules ignoring classes with empty findings.
0.10.7
- Add tips to rule building using
because(). - Add
readonly()selector andshouldBeReadonly()assertion.
0.10.6
- Added parent and direct interfaces as dependencies.
- Fixed Stringable not treated as built-in class.
0.10.5
- Added
Selector::AND()modifier.
0.10.4
- Added
ignore_built_in_classesoption to ignore built-in classes on relation assertions. - Added
show_rule_namesoption to output the rule name before the error message. - Added class Attributes as dependencies.
- Fixed template names getting resolved as FQCNs.
0.10.3
- Added
canOnlyDepend()assertion.
0.10.2
- Added
shouldBeAbstract()andshouldNotBeAbstract()assertions. - Fixed
shouldNotDependOn()assertion ignoring static method calls.
0.10.1
- Added
shouldBeFinal()andshouldNotBeFinal()assertions.
0.10.0 ⚠
- Reconversion of the project as a PHPStan extension
Read the upgrade guide for more information.
0.9.1
- Read configured
tests.pathrecursively
0.9.0
- Fix phar file generation
- Make paths relative to configuration file
0.8.4
- Update event-dispatcher to allow psr/container v2
0.8.3
- Fix class property types not caught as dependencies
- Support PHP 8.1 features:
- Enums
- never type
- Intersection types
0.8.2
- Add Symfony 6 compatibility
0.8.1
- Fix exception when no files found in path selector
- Improve RegexClassName match performance
0.8.0
- Add PHP 8.0 and 8.1 compatibility
- Drop PHP 7.2 and 7.3 compatibility
- Support PHP 8.0 features:
- Constructor promotion
- Named Parameters
- Union Types
- Attributes
- Match and Throw Expression
- Rename
ignore_docblockstoignore-docblocks - Rename
ignore_php_extensionstoignore-php-extensions - Remove
dry-runoption - Add
php-versionoption to force emulative lexer php version - Move main executable file to
/bin/phpat - Update min/max composer dependencies versions
- Remove BetterReflection usage
- Add default composer configuration
- Accept snake_case test filenames
- Baseline file
- Fix wrongly mapped fully qualified classnames on docblocks
- Ignore dependencies out of the class context
- Remove regex selections with results from origins to avoid duplicated statements
0.7.7
- Do not analyze excluded files (+info)
0.7.6
- Move CI to GitHub Actions
- Optimize FullClassName usage
0.7.5
- Fix random silent failures while creating internal php classmap
- Fix test file valid names
- Set default verbosity on invalid configuration
0.7.4
- Fix exclusions when they are not part of the src
- Allow to include test files with more valid names
0.7.3
- Change composer package name to
phpat/phpat - Refactor AST build to a better-reflection/php-parse hybrid
- Add support to generic types in docs
- Add support to callable types in docs
- Add support to union types in docs
- Fix src path configuration sometimes giving issues
- Drop Symfony 2 compatibility
- Move Fatal Error exceptions out of event listener
- Fix issue with FQCNs starting with backslash
- Add psalm and phpstan to CI checks
0.7.2
- Move composer parsing to ReferenceMap creation stage
- Include unknown FQCNs (out of src) in ClassNameSelector
0.7.1
- Fix composer dependencies with empty namespace selected as
*
0.7.0
- Package name changed to
phpat/phpat - Add support for tests in YAML and XML files
- Ignore only core and extension classes (instead of all classes without namespace)
- Add
ignore_php_extensionsoption - Change
ignore_docblocksoption name - Change the configuration needed for composer selectors:
- Modify
ComposerSourceSelectorandComposerDependencySelectorso: areAutoloadableFromComposerselects non-dev composer autoload classesareDevAutoloadableFromComposerselects dev composer autoload classesareDependenciesFromComposerselects non-dev composer dependenciesareDevDependenciesFromComposerselects dev composer dependencies
0.6.1
- Fix exclusions ignored in non-ast classes
- Add
ComposerSourceSelectorandComposerDependencySelector
0.6.0
- Add selection out of the src scope using full or partial class names
- Add warnings when using regex class names with affirmative
mustassertions - Fix some docblock types not resolved
- Fix error while using anonymous classes
0.5.8
- Add warnings when selectors do not find any class
- Fix group use declarations
- Fix some functions and primitive types resolved as classes
- Ignore dependencies without namespace (predefined PHP classes)
0.5.7
- Added support for
*on include and exclude options - Fixed ignored include option when using other than PathSelector
- Modified command now looks for default
phpat.yamlorphpat.ymlfiles - Modified success report character from
·to.
0.5.6
- Fixed false exception message shown on violated rules report
0.5.4
- Added dry-run to internal errors
- Modified fatal error handler
- Modified executable to match php version requirement
- Fixed include option
0.5.3
- Added
CanOnlyImplementandMustOnlyImplementrule types - Added
CanOnlyIncludeandMustOnlyIncluderule type - Added
CanOnlyDependandMustOnlyDependrule types - Added
CanOnlyExtendrule type - Modified statements now check all the defined relations of a class
- Fixed native PHP classes not correctly found
0.5.2
- Added
Selector::implementInterfaceto select classes that implement a certain interface - Added
Selector::extendClassto select classes that extend a certain class - Added
Selector::includeTraitto select classes that include a certain trait - Added some PHP configurations (error_reporting, display_errors, gc_disable)
- Added verbosity as a cli command option
- Fixed options being ignored in configuration files
0.5.1
- Added
Selector::haveClassNameto select classes by fully qualified names - Performance boost by building an AST map instead of parsing each time
0.5.0
- Added a changelog :smile:
- Changed Minimum PHP version from
7.1to7.2. - Changed dependency
symfony/event-dispatchertocarlosas/simple-event-dispatcher.