Update dependency phpstan/phpstan to v1
This MR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| phpstan/phpstan | require-dev | major |
0.12.88 -> 1.3.0
|
Release Notes
phpstan/phpstan
v1.3.0
Major new features 🚀
-
Support for PHP 8.1 Enums - RFC
- Thanks to @kukulich for custom Enum rules!
- Upgraded Roave/BetterReflection to 5.0.0
- PHP 7.1+ is still supported because the dependency is downgraded automatically in our own fork
- This brings plenty of bugfixes, for example PHP 8.0 Attributes can now be read in static reflection context
- PHPStan now works when OPCache is enabled!
- Thanks to this commit: phpstan/phpstan-src@
e30f446
- Thanks to this commit: phpstan/phpstan-src@
- The development repository
phpstan/phpstan-srcis now PHP 8.0+ only, while the distribution packagephpstan/phpstanstill supports PHP 7.1+.- This is achieved thanks to automatic downgrade of source code using Rector during PHAR compilation
- PHPStan now ships with Symfony PHP polyfills for PHP 7.2-8.0.
Improvements 🔧
- Update
nikic/php-parserto 4.13.2 (phpstan/phpstan-src@8939964) - Update to Symfony 5.4 (#863)
- CLI option
--allow-empty-baselineto allow generating empty baseline (#776), thanks @Lctrs! - Support for
@phpstan-property,@phpstan-property-read, and@phpstan-property-write(#775), thanks @mad-briller! - Add support for the
key-of<...>andvalue-of<...>types (#800), thanks @ste93cry! - GithubErrorFormatter > Allow any
ErrorFormatter(#854), thanks @ruudk! - Array unpacking support for string-keyed arrays (#803), thanks @canvural!
- Moved some classes from ClassBlacklistReflectionProvider to staticReflectionClassNamePatterns config so that they are in effect for ClassBlacklistSourceLocator too (phpstan/phpstan-src@
e40ba15) - PHPStanTestCase: Added a helper method to assert no errors happend (#894), thanks @staabm!
Bugfixes 🐛
- Resolve deprecated tag also from parents (#792), thanks @eiriksm!
-
echoisn't callable either. (#777), thanks @johnbillion! - Resolve object type by class const fetch in switch statement (#745), thanks @marmichalski!
- Allow also
$object::classwith Identical (#745), thanks @marmichalski! - Fixed ErrorFormatter tests in terminals with console support (#805), thanks @kukulich!
- Copy all environment variables when running PHPStan Pro (phpstan/phpstan-src@
e61ad95), #5433 - Allow destructuring of objects implementing ArrayAccess (#819), thanks @herndlm!
- Spreading of general arrays should not lead to a non-empty-array (#818), thanks @herndlm!
- Simplify FileTypeMapper (phpstan/phpstan-src@
256d11b) - Make FileTypeMapper more deterministic (phpstan/phpstan-src@
ae6dca5) - Fix normal vs. stub PHPDoc (phpstan/phpstan-src@
e9dd3a3) - ReflectionAttribute is no longer final class (phpstan/phpstan-src@
97e153c) - ReflectionAttribute stub - IS_INSTANCEOF constant (phpstan/phpstan-src@
cfb6fad) - DependencyResolver - cause autoloading less often when looking at literal arrays (phpstan/phpstan-src@
b927c87), #6187, #6096 - MemoizingReflectionProvider - cache
hasClass()as case-sensitive (phpstan/phpstan-src@792ce0a), #6096 - XdebugHandler - setPersistent (#726), #5809, thanks @fsmoak!
- Simplify AutoloadSourceLocator - let it actually autoload the file (phpstan/phpstan-src@
e30f446) - AutoloadSourceLocator - filter classes by startLine only if there are multiple of them (#882)
- ComposerJsonAndInstalledJsonSourceLocatorMaker - fix for autoload-dev section (#882)
- TestCaseSourceLocatorFactory - skip invalid Composer locations (#882)
- Fix ReturnTypeRule (#882)
- Silent
@operator should use& $errnocheck (#889), thanks @samsonasik! - ClassTemplateTypeRule should not be executed for interfaces (phpstan/phpstan-src@
9adf6bf) - MixinRule - check interfaces and enums (phpstan/phpstan-src@
8519cca)
Function signature fixes 🤖
- Added DynamicReturnTypeExtension for
trigger_error(#766), thanks @staabm! - The array returned by
array_count_values()can never contain a zero. (#773), thanks @johnbillion! - Add ThrowableReturnTypeExtension (#795), thanks @herndlm!
- Update functionMap for XSLTProcessor (#797), thanks @hbrecht!
- imap_delete / imap_undelete: correction (#799), thanks @hbrecht!
- Fix the signature of the value returned from the
date_parseanddate_parse_from_formatfunctions (#807), thanks @ste93cry! - Fix the signature of
get_resources()(#837), thanks @MidnightDesign! - Fix preg_filter function signature (#826), thanks @johnstevenson!
- Fix ldap_set_rebind_proc signature (#851), thanks @villfa!
-
restore_error_handlerandrestore_exception_handleralways return booleantrue. (#850), thanks @johnbillion! - More specific return types for some
DateTimeZonemethods (#857), thanks @johnbillion! - Add missing
Set::map()method toext-dsstub (#855), thanks @simPod! - Support variable constant flags in
preg_split(phpstan/phpstan-src@a16c7ae), thanks @clxmstaab!
v1.2.0
Improvements 🔧
- Support for some features from PHP 8.1
- Support for
newin initializers - RFC (phpstan/phpstan-src@1a102fe) - Support for first-class callables - RFC
- Support for
array_is_list()- RFC (#770), thanks @canvural!
- Support for
- Support
literal-stringwith encapsed strings (#768), thanks @craigfrancis! - Tips for always used properties and constants extensions (phpstan/phpstan-src@
2db3c26) - Autowire rules from the
rulesconfig section by their class name (phpstan/phpstan-src@50cb90d)
Bugfixes 🐛
- Type system: ConstantStringType created from
::classis always considered a classname (phpstan/phpstan-src@da34d3f), #5979 - Do not run PHP bug workaround on PHP 8+ where it's fixed (phpstan/phpstan-src@
6573959), #5954 - Promoted properties do not have a default value (phpstan/phpstan-src@
7c8e81d), #5906 - CleaningParser - do not remove inline
@vartags (phpstan/phpstan-src@2652f2d), #5921 - AttributesCheck - do not report named arguments in attributes (phpstan/phpstan-src@
6366066), #5898
Function signature fixes 🤖
- functionMap - removed functions that are reserved keywords and separate AST nodes (phpstan/phpstan-src@
08f3e2d), #6014
v1.1.2
Bugfixes 🐛
- Properties are read when using AssignRef (
=&) too (phpstan/phpstan-src@74787be), #5935 - Fixed internal error with method attributes referencing
self::(phpstan/phpstan-src@b5e44f7), #5951 - Fix stub namespaces in some extensions like
pecl_http(ondrejmirtes/BetterReflection@9f2b6eb, ondrejmirtes/BetterReflection@bdd2523), #5460, thanks @kukulich! - Do not attempt to clear old containers if the directory does not exist (phpstan/phpstan-src@
2427b83)
Function signature fixes 🤖
- Mark file resource functions as having side effects (#698), thanks @jlherren!
- Use positive integers for various time functions (#760), thanks @staabm!
v1.1.1
Bugfixes 🐛
- Fixed
/** @​phpstan-ignore-line */and/** @​phpstan-ignore-next-line */annotations sometimes not working because of AST (phpstan/phpstan-src@9474696), #4750, #4759, #3834, #3563, #4250, #4798 - Do not report non-existent function after
function_exists()check (phpstan/phpstan-src@28e8c11), #3576 - Make
function_exists()similar tois_callable()(phpstan/phpstan-src@4a98863), #1849
v1.1.0
Improvements 🔧
- Update
nikic/php-parserto 4.13.1 (phpstan/phpstan-src@6a64c8a), #5458 - Update
jetbrains/phpstorm-stubs(phpstan/phpstan-src@546e87c), #5833- Support for
PhpStormStubsElementAvailableattribute injetbrains/phpstorm-stubs(phpstan/phpstan-src@e41e66a)
- Support for
- Support for some features from PHP 8.1
- Support for native
neverreturn type - RFC (phpstan/phpstan-src@59be92f) - Support for native pure intersection types - RFC (phpstan/phpstan-src@
be05557, phpstan/phpstan-src@021e25e), #5870 - Support for tentative return types - RFC (phpstan/phpstan-src@
0e98150, phpstan/phpstan-src@762fc47) - ReflectionEnum runtime stubs (PHP 8.0+) (phpstan/phpstan-src@
e3a0e0d)- Full Enums support is coming in a later release
- Support for native
Bugfixes 🐛
- Fix chaining nullsafe operator (#752), #5868, thanks @olsavmic!
Function signature fixes 🤖
- Fix return type of
get_loaded_extensions()(#754), thanks @dktapps! -
call_user_func_array()support named arguments (#727), thanks @mglaman! -
phpversion()does not return false when no arguments are given (#753), thanks @dktapps!
v1.0.2
Bugfixes 🐛
- Analyze
Composernamespace only with static reflection, some classes in PHAR are unprefixed (phpstan/phpstan-src@95754d1), composer/composer#10253 - ArrayType - use BenevolentUnionType even if it contains StrictMixedType (phpstan/phpstan-src@
c59330c), #5834, #5881, #5872, #5861- This fixes "expects array, array given" errors
Function signature fixes 🤖
- Unified the name of the second
array_mapparameter (phpstan/phpstan-src@9433345) - More precise
connection_aborted()signature (#715), thanks @staabm! - More precise
str_split()signature (#718), thanks @staabm! -
DateFunctionReturnTypeExtension: support more precise single-char date-formats (#721), thanks @staabm! - Support
$preserve_keysargument foriterator_to_array()(#748), thanks @Lctrs!
v1.0.1
- Fixed "Expected node type PhpParser\Node\Stmt\Property, NULL occurred" (phpstan/phpstan-src@
e5f8e72), #5875 -
DerivativeContainerFactory- pass all arguments to the derived container (phpstan/phpstan-src@f28c7e9) -
PhpStanNamespaceIn3rdPartyPackageRule- fix segfault when there's no composer.json (phpstan/phpstan-src@d4efedb)
v1.0.0
PHPStan 1.0 is here and I'm really excited about it! Read the accompanying article on PHPStan's blog and also check out the merchandise we're selling for limited time (until November 22nd). It includes white and blue PHPStan t-shirts, PHPStan stickers, and also something very special: Rule level badges that you can pin to your clothes to show off that you care about code quality
Major new features 🚀
- Level 9 with checkExplicitMixed (phpstan/phpstan-src@
e5bbb52) - Consistent remembering and forgetting returned values (phpstan/phpstan-src@
d4edc59) - Precise try-catch-finally analysis (phpstan/phpstan-src@
4588e73) - Validate overriding methods in stubs (phpstan/phpstan-src@
c98d0a4) - Nicer type descriptions usable in PHPDocs (phpstan/phpstan-src@
03341cc, phpstan/phpstan-src@51d7431)
New rules
- Level 0
- Check leading and trailing file whitespace and BOM (phpstan/phpstan-src@
6905d66) - Check overriding constants (phpstan/phpstan-src@
89acb0d) - Check classes extending
@finalclasses (phpstan/phpstan-src@dffd2c2), <https://github.com/phpstan/phpstan/discussions/
- Check leading and trailing file whitespace and BOM (phpstan/phpstan-src@
Renovate configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.
