PHPStan v0.12.19 Release Notes
Release Date: 2020-04-19 // about 4 years ago-
๐ฑ Major new features ๐
- PHPStan has a new website with documentation, refreshed playground, and blog! Read more about it here
- Ignoring errors in code using comments : use
@phpstan-ignore-line
or@phpstan-ignore-next-line
to ignore errors locally. Examples in the documentation, original issue #786
๐ Improvements ๐ง
- Code around
class_exists()
does not complain about nonexistent classes (phpstan/phpstan-src@1605bb2), #3169, #2529, #265, #188, #146, #2359, #308 - Result cache - run full analysis after 7 days since the last full analysis (before it was 24 hours) (phpstan/phpstan-src@1b72fa1)
- ResultCacheManager - exclude XDebug from the list of loaded extensions (phpstan/phpstan-src@8ce9207) - to be able to debug result cache behaviour even if it was first saved without XDebug enabled
- ๐ Support single-quoted and double-quoted keys in array shapes (phpstan/phpstan-src@e210a6e)
- ConstantStringType - do not truncate existing class names (phpstan/phpstan-src@c5c49c1), #3145
- PHAR file is around 2 MB smaller and contains 500 less files (phpstan/phpstan-src@f31ee7c)
phpstan/phpstan
intentionally conflicts withphpstan-shim
- you should installphpstan/phpstan
only (#3139), thanks @szepeviktor!- ๐ Documentation URL showed with autoloading errors (phpstan/phpstan-src@836d227)
- โก๏ธ Update to nikic/php-parser 4.4.0 (phpstan/phpstan-src@2514514)
- ๐จ Print stacktrace when including bootstrap-files throws (#51), thanks @staabm!
- โ Added
is_countable()
to TypeSpecifyingFunctionsDynamicReturnTypeExtension (phpstan/phpstan-src@8a894c5)
๐ Bugfixes ๐
- Solve
timecop
extension issues by enabling static reflection forDateTime
classes (phpstan/phpstan-src@d59629b), #2801 - ๐ Fixed false-negative with
checkExplicitMixedMissingReturn: true
(phpstan/phpstan-src@08b4eab) - ๐ Fix issue in method return type override annotation on same class or from trait (#173), #3155, thanks @Korbeil!
- ๐ Fix overriding trait properties in PHPDocs (phpstan/phpstan-src@55a3444), #1216
- ๐ Checkstyle error formatter - always use file path, not file description (phpstan/phpstan-src@94dc8d2), #1872
- ๐ Fix SOAP extension issues (#182), #618
- Result cache gets invalidated with different
-a|--autoload-file
CLI option passed (phpstan/phpstan-src@37c29d5)
๐ฑ Function signature fixes ๐ค
strip_tags
2nd parameter accepts array on PHP 7.4 (phpstan/phpstan-src@7d3123d), #3125- More precise
Phar::getSignature()
signature (phpstan/phpstan-src@4b23061) - ๐ Fixed
DateInterval::$days
type (phpstan/phpstan-src@4e64f0d), #3127 - ๐ Fix return type of
IntlDateFormatter::parse()
(#172), thanks @ADmad! date_create_from_format()
: accepts null (#174), thanks @homersimpsons!- โก๏ธ Update ext-ds.stub (#180), thanks @enumag!
- ๐ Fix inferred union types for Ds
Map::get()
andMap::remove()
(#176), thanks @simPod! readlink()
may return false on error (#178), thanks @dktapps!hash_file()
returns false and emits E_WARNING on nonexisting file (#179), thanks @dktapps!