Changelog History
Page 3
-
v0.12.39 Changes
August 24, 2020๐ Improvements ๐ง
๐ฑ Bleeding edge ๐ช
- โ Add
SplObjectStorage
stub (#301), #3111, thanks @VincentLanglet!
๐ If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:includes: - vendor/phpstan/phpstan/conf/bleedingEdge.neon
Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
๐ Bugfixes ๐
- Understand array is not empty after
count($array) > 0
and similar conditions (#305), thanks @ossinkine! - โ Remove NonEmptyArrayType after
unset()
(phpstan/phpstan-src@e96481c) - ๐ functionMap should not be prefixed in the PHAR (phpstan/phpstan-src@79bae4b), #3776
- โ Add
-
v0.12.38 Changes
August 19, 2020๐ Improvements ๐ง
- ๐ PHP 8: Support for
static
return type (phpstan/phpstan-src@75ff705) - โ Add support for the
callable-string
type (#296), thanks @ste93cry! - โก๏ธ Updated
nikic/php-parser
to 4.9.0 (phpstan/phpstan-src@05b6a54) - Doc comment above class doesn't have to exist if it has a stub file (phpstan/phpstan-src@17315cb)
min()
andmax()
may return false if array size could be zero (#300), thanks @dktapps!
๐ Bugfixes ๐
- ๐ Fix internal error with an unknown interface (phpstan/phpstan-src@19fab3f)
- Property is also read for
??=
and other assign ops (phpstan/phpstan-src@efb11ec, phpstan/phpstan-src@71c51e4), #3735, #3636 - PHAR compiler - preload
src/
too (phpstan/phpstan-src@ca70ff0), #3731
๐ฑ Function signature fixes ๐ค
- ๐ PHP 8: Support for
-
v0.12.37 Changes
August 09, 2020๐ Improvements ๐ง
- โ Added TeamCity error formatter (#295), thanks @MaximilianKresse!
- โก๏ธ Updated
nikic/php-parser
to 4.8.0 (phpstan/phpstan-src@65a74c6) - โก๏ธ Updated
LexerFactory
to take advantage of the newEmulative
lexer capabilities (phpstan/phpstan-src@71013bc) - some of the new syntax from PHP 7.3, 7.4, and 8.0 will now be marked as parse error on lower PHP versions
๐ Bugfixes ๐
- Escape special
nette/di
characters in BaselineNeonErrorFormatter (phpstan/phpstan-src@7336df1), #3705
-
v0.12.36 Changes
August 05, 2020๐ Improvements ๐ง
- Introduced NodeConnectingVisitor to be able to look around the current node in rules (phpstan/phpstan-src@e72ef39)
- โ Add support for
@phpstan-throws
(#292), thanks @VincentLanglet! - Generics: disallow variance definition other than in class or interface (#278), thanks @hrach!
๐ Bugfixes ๐
- โก๏ธ Update BetterReflection - fixes bug with namespaced constants (phpstan/phpstan-src@8188304), #3712
- Prevent internal error in case of unknown constant (phpstan/phpstan-src@e964816), #3379
- ๐ Fix detecting unused property from class used in trait (phpstan/phpstan-src@11ef998), #3716
-
v0.12.35 Changes
August 04, 2020๐ Bugfixes ๐
- ๐ Fixed parent class of ParseError on PHP < 7.3 (phpstan/phpstan-src@353cb01), #3690
- ๐ Fix unknown constants as default parameter values (phpstan/phpstan-src@d3044ee), #3635, #3629
- Private __clone method isn't considered unused (phpstan/phpstan-src@cdbed86), #3630
- Do not report unused private methods/properties in traits (phpstan/phpstan-src@5958c29), #3637
- ๐ Fix anonymous class that extends the outer class (phpstan/phpstan-src@4cad0c6), #3663
- ๐ Fix infinite loop (phpstan/phpstan-src@6d81881), #3686
๐ฑ Function signature fixes ๐ค
- Correct return types for
odbc_connect()
andodbc_prepare()
(#289), thanks @duncan3dc!
-
v0.12.34 Changes
July 30, 2020๐ Improvements ๐ง
@mixin
above classes with__callStatic()
creates static methods (phpstan/phpstan-src@aa38695), #3641- Detect cache saving error (phpstan/phpstan-src@542238a), #3638
- โก๏ธ Updated nikic/php-parser to 4.7.0 (phpstan/phpstan-src@5a3deae)
- Improved PHP 8 compatibility after Treat namespaced names as single token RFC got merged into php-src
๐ Bugfixes ๐
- ๐ Handle
yield
in for loop, foreach loop, while loop, do-while loop, if condition, switch statement (#286), thanks @dantleech! - ๐ Fix missing method
Generator::throw()
(phpstan/phpstan-src@153c874), #3683, #3418 - ๐ Fix anonymous class with PHPDoc (#283), #3661, thanks @dbrekelmans!
๐ฑ Function signature fixes ๐ค
-
v0.12.33 Changes
July 19, 2020๐ Improvements ๐ง
- ๐ Initial PHP 8 support!
- PHPStan can now analyse sources for PHP 7.x when running on PHP 8. Not all the new PHP 8 features are supported yet.
- Support for native union types (phpstan/phpstan-src@39f8909)
- Support for native
mixed
type (phpstan/phpstan-src@a9043e0)
- Set different PHP version than your runtime
- If you set different
phpVersion
parameter in yourphpstan.neon
, you can for example tell PHPStan to analyse source code like it's written for PHP 7.4 even if you're running PHP 8. ThephpVersion
config parameter is inPHP_VERSION_ID
format - for PHP 7.4, use70400
. - You can also set a newer PHP version. So you can run PHPStan on 7.4, but already test compatibility with PHP 8 by setting
phpVersion
to80000
.
- If you set different
- Check uninitialized typed properties that aren't set in the constructor (phpstan/phpstan-src@a1eb1f5), #2984
- Off by default, needs
checkUninitializedProperties: true
.
- Off by default, needs
- ๐ Show error on unescaped
()
in ignoreErrors (phpstan/phpstan-src@8479d40), #3602
๐ฑ Bleeding edge ๐ช
- Detect unused and write-only/read-only private properties, methods, and constants (level 4)
config.platform.php
in project'scomposer.json
is respected and overrides the current runtime PHP version (phpstan/phpstan-src@d235195).
๐ If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:includes: - vendor/phpstan/phpstan/conf/bleedingEdge.neon
Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
๐ Bugfixes ๐
- ๐ Skip not deprecated methods (#267), thanks @malarzm!
- Type aliases cannot be used internally because they might clash with an existing class name (phpstan/phpstan-src@4d08280), #3569
- ๐ Fix covariant type check when template has bound (#272), thanks @hrach!
๐ฑ Function signature fixes ๐ค
- โก๏ธ Updated phpstorm-stubs (phpstan/phpstan-src@e1f492c), #3539, #3512, #3525
- โก๏ธ Updated GD's
image*
functions (#265), thanks @javajawa! - PDOStatement::fetchColumn can return an int (#266), thanks @anthonyryan1!
- XMLReader::expand may return false on error (#273), thanks @taavit!
- SQLite3Stmt::execute to return false (#275), thanks @colinmo!
- mime_content_type can receive a stream too (#276), thanks @gnutix!
- Fix date_time_set function signature (#280), thanks @olivierchabert!
- ๐ Initial PHP 8 support!
-
v0.12.32 Changes
July 01, 2020๐ Improvements ๐ง
- 0๏ธโฃ Make GithubErrorFormatter the default when running in GitHub Actions (phpstan/phpstan-src@6fd85e3)
- If you're currently running PHPStan with
--error-format checkstyle | cs2pr
, you can omit this part from your build script! - You can override this behaviour by running with
--error-format table
.
- If you're currently running PHPStan with
- Error formatter
github
for GitHub Actions (#261), thanks @Quetzacoalt91!
๐ฑ Bleeding edge ๐ช
- Check leading and trailing file whitespace and BOM (phpstan/phpstan-src@6905d66)
๐ If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:includes: - vendor/phpstan/phpstan/conf/bleedingEdge.neon
Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
๐ Bugfixes ๐
- ๐ Fix handling unpacked argument with constant arrays (phpstan/phpstan-src@a21012d), #3481
- 0๏ธโฃ Make GithubErrorFormatter the default when running in GitHub Actions (phpstan/phpstan-src@6fd85e3)
-
v0.12.31 Changes
June 24, 2020๐ Bugfixes ๐
- Subclasses of PDO are analysed using static reflection (phpstan/phpstan-src@8390949), #3527
- ๐ Fix problems related to conditional declarations of classes - #3522
- Dive into a trait that starts on the same line as the one in the reflection (phpstan/phpstan-src@e6dd87b), #3460
๐ฑ Function signature fixes ๐ค
ZipArchive::open()
returns true on success, int (error code) on failure (#253), thanks @dktapps!mysqli_stmt_fetch()
andmysqli_stmt::fetch()
can return NULL (#255), thanks @morozov!openssl_pkey_export()
allows null for the passphrase (#256), thanks @ConradSollitt!- Fix
enchant_broker_list_dicts()
return type (#257), #3530, thanks @villfa! - correct return value for PHP internal functions on failure (#258), thanks @peter-gribanov!
- ๐ Fix return type & callback type hints for Redis::subscribe() (#259), thanks @hollodotme!
-
v0.12.30 Changes
June 21, 2020๐ Improvements ๐ง
- โจ Enhancements for analysis of view files implemented in plain PHP (#351)
- All variables including
$this
in the root scope are always "maybe-defined" which means they won't be reported on level 0 but on level 1 (phpstan/phpstan-src@0613451, phpstan/phpstan-src@14b17a8), #351 - Variables in the root scope can be made always defined with inline
@var
PHPDoc (phpstan/phpstan-src@44f9d08) - Support multiple doc comments above statement (phpstan/phpstan-src@428c8e5)
- All variables including
- Detect duplicate declarations of class constants, properties, and methods (#250), #3475, thanks @dktapps!
- ๐ Support for BitwiseNot (
~
) operator (#249), thanks @dktapps!
๐ Bugfixes ๐
- Classes that extend ext-dom classes are always analysed using static reflection (#242), #3477, thanks @schlessera!
- Look at
install-path
frominstalled.json
available in Composer v2 (phpstan/phpstan-src@4cf0141), #3426 - Skip files from broken Composer installations (phpstan/phpstan-src@d1990b8), #3426
- ๐ Fix DOMDocument child class contravariance check (phpstan/phpstan-src@09f0beb), #3478
๐ฑ Function signature fixes ๐ค
- โก๏ธ Update jetbrains/phpstorm-stubs (solves #3492, #3482, #3480)
- dbase-ext: DB-handle changed from int to resource (#246), thanks @swen100!
dbase_open
anddbase_create
can also return false (#246), thanks @swen100!- functionMap: narrow possible return values of openssl_verify() (#250), thanks @dktapps!
- Loosen the requirements for the $function parameter of the register_shutdown_function function (#240), thanks @ste93cry!
- โจ Enhancements for analysis of view files implemented in plain PHP (#351)