PHPStan v0.12.26 Release Notes
Release Date: 2020-06-07 // almost 4 years ago-
๐ Read more about this release in a feature article on PHPStan's blog ยป
๐ฑ Major new features ๐
Static reflection
- ๐ Less configuration needed. PHPStan no longer needs autoloading configuration setup, it works out of the box in most situations. Check out Discovering Symbols guide in the documentation for more details.
- Introduced new related configuration options
scanFiles
, andscanDirectories
. Deprecatedautoload_files
, andautoload_directories
.
- Introduced new related configuration options
- It's now possible to analyse files that mix class/function declarations and side-effects.
๐ Improvements ๐ง
- ๐ ConstantStringType - mark values coming from
::class
constant explicitly, for performance reasons (phpstan/phpstan-src@9814ab0), #3054, #3193, #1275 - Limit size of ConstantArrayType coming from literal array (phpstan/phpstan-src@8527777), #3055, #1275
- Inherit PHPDocs from internal classes (phpstan/phpstan-src@e686505), #1802, #1682, #2445
- Option
checkExplicitMixed
that will eventually become level 9 (phpstan/phpstan-src@da0b2eb) - ๐จ Used memory will be printed with
-v
(phpstan/phpstan-src@a90b290) - โก๏ธ Update nikic/php-parser to 4.5.0 (phpstan/phpstan-src@876d146)
- ๐ Don't merge deprecated tag with parents (#225), thanks @ossinkine!
๐ Bugfixes ๐
- ๐ Add LIBXML_VERSION & LIBXML_DOTTED_VERSION dynamic constants (#203), thanks @schlessera!
- NodeScopeResolver - fix processing args in New_ (phpstan/phpstan-src@9b62d91)
- FileReader - assert is_file() before reading (phpstan/phpstan-src@9fd30bf), #3304
- Do not analyse trait method that's shadowed in the using class (phpstan/phpstan-src@a2044e6), #2935
- ๐ Fix yield from return type (#207), thanks @enumag!
- ๐ FileAnalyser - fixed unignorable errors that were thrown away (phpstan/phpstan-src@7dc1de3)
- Generics: fix isSuperTypeOf implementations (#206), thanks @hrach!
- โก๏ธ OptimizedSingleFileSourceLocator - fix const handling (phpstan/phpstan-src@6204ebe), #2868
- ๐ get_class extension: fix support for generics (#209), #3263, thanks @hrach!
- Always accept
isset($array[$string])
(#214), thanks @nobuf! - InstanceOf: fix uncertainty (#211), thanks @hrach!
- 0๏ธโฃ IncompatibleDefaultParameterTypeRule - fix analysed functions with reflection from different place (phpstan/phpstan-src@50915ce), #3349
- 0๏ธโฃ Check default property value against native type (phpstan/phpstan-src@4329b07)
- 0๏ธโฃ Default value property type does not observe strict types - it's always strict (phpstan/phpstan-src@fe72e26)
๐ฑ Function signature fixes ๐ค
- Fix
mb_convert_encoding()
(#213), thanks @marcu87! - โ Added stubs for SplDoublyLinkedList, SplQueue and SplPriorityQueue (#205), thanks @dktapps!
- PDO stub - add missing constants (phpstan/phpstan-src@3734c3f), #2883
- ๐ Fix return values for date_parse() (#217), thanks @cxj!
- DynamicReturnType for array search call not strict (#215), thanks @VincentLanglet!
- ๐ Fix some SplFileObject signature (#220), thanks @VincentLanglet!
- ๐ Make toArray() return list in ext-ds (#221), thanks @simPod!
- ๐ Fix sapi_windows_set_ctrl_handler signature (#224), thanks @Seldaek!
- ๐ Fix signature of XSLTProcessor::transformToXml (#226), thanks @czjvic!
- ๐ Less configuration needed. PHPStan no longer needs autoloading configuration setup, it works out of the box in most situations. Check out Discovering Symbols guide in the documentation for more details.