chore(deps): update dependency phpstan/phpstan to v1.11.10
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| phpstan/phpstan | 1.10.36 -> 1.11.10 |
Release Notes
phpstan/phpstan (phpstan/phpstan)
v1.11.10
v1.11.9
Bleeding edge 🔪
- RegularExpressionPatternRule: validate preg_quote'd patterns (#3270), thanks @staabm!
- No implicit wildcard in FileExcluder (https://github.com/phpstan/phpstan-src/commit/e19e6e5f8cfa706cc30e44a17276a6bc269f995c), #10299
- Precise array shape for
preg_match_all()$matches (#3256), thanks @staabm!
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. Learn more
Improvements 🔧
- DefaultStubFilesProvider - consider all composerAutoloaderProjectPaths when filtering 3rd party stub files (https://github.com/phpstan/phpstan-src/commit/582a0f8a744fa2ebda2d98783c55c78183e8bbed), #11393
Bugfixes 🐛
- RegexArrayShapeMatcher: Fix non-emptiness of leading optional groups (#3267), #11376, thanks @staabm!
- RegexArrayShapeMatcher: Support resolving of constants in patterns (#3265), #11384, thanks @staabm!
- RegexExpressionHelper - Support all bracket style delimiters (#3273), thanks @staabm!
- Regex parsing fixes for newline characters and marker verbs (#3268), #11360, #8948, thanks @Seldaek!
- RegexArrayShapeMatcher - Support 'n' modifier (#3271), thanks @staabm!
- Improve
abs()return type (#3263), #11367, thanks @julienfalque! - UselessFunctionReturnValueRule: More precise error message (#3266), #11377, thanks @staabm!
Internals 🔍
- Extract RegexExpressionHelper (#3270), thanks @staabm!
- Refactor RegexArrayShapeMatcher (#3274), thanks @staabm!
v1.11.8
Bleeding edge 🔪
- Report useless return values of function calls like
var_exportwithout$return=true(#3225), #11320, thanks @staabm! - Check mixed in binary operator (#3231), #7538, #10440, thanks @schlndh!
- Check vprintf/vsprintf arguments against placeholder count (#3126), thanks @staabm!
- Check mixed in unary operator (#3253), thanks @schlndh!
- Report "missing return" error closer to where the return is missing (https://github.com/phpstan/phpstan-src/commit/04f8636e6577cbcaefc944725eed74c0d7865ead)
- Stricter ++/-- operator check (#3255), thanks @schlndh!
- Check preg_quote delimiter sanity (#3252), #11338, thanks @staabm!
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. Learn more
Improvements 🔧
- Precise array shape for
$matchesfrompreg_match()improvements:- RegexArrayShapeMatcher - trailling groups are not optional when PREG_UNMATCHED_AS_NULL (#3219), #11311, thanks @staabm!
- Fix preg_match named capturing groups (#3228), #11323, thanks @staabm!
- RegexArrayShapeMatcher - Fix optional groups with PREG_UNMATCHED_AS_NULL (#3229), thanks @staabm!
- Allow overriding the PHP 7.2 support for PREG_UNMATCHED_AS_NULL (#3226), thanks @Seldaek!
- RegexArrayShapeMatcher - Fix PREG_UNMATCHED_AS_NULL with optional leading groups (#3234), #11331, thanks @staabm!
- RegexArrayShapeMatcher - Support preg_quote()'d patterns (#3233), #11332, thanks @staabm!
- RegexArrayShapeMatcher - Fix PREG_UNMATCHED_AS_NULL with top level alternation (#3238), thanks @staabm!
- RegexArrayShapeMatcher - More precise non-empty-string and numeric-string (#3249), thanks @staabm!
- Fix regex parsing by completing the grammar (#3244), thanks @Seldaek!
- RegexArrayShapeMatcher -
(\d*)can be empty-string (#3257), thanks @staabm!
- Add
diagnosecommand to run DiagnoseExtensions (https://github.com/phpstan/phpstan-src/commit/22c84d2e64dd30780c995d8a720a487bb484dc02) - Diagnose extension: Info about extensions installed via extension-installer (https://github.com/phpstan/phpstan-src/commit/db71f04aa14f5be6421e92d7b76031605de5ad80)
- Diagnose extension - where is PHPStan running from (https://github.com/phpstan/phpstan-src/commit/76464eed45dee10154cb25b9f05586c346046adc)
- Parallel scheduler becomes DiagnoseExtension (https://github.com/phpstan/phpstan-src/commit/c7c9689cd86a9811eeaa2bb365ab5bc302109802)
- ResultCacheManager: output restore time in debug mode (#3224), thanks @janedbal!
- Add hint as to what might be wrong when invalid identifiers are used (#3230), thanks @Seldaek!
- Optimize array_map with many arrays (https://github.com/phpstan/phpstan-src/commit/09fbc92c415a2b9789463b3ca8fa7c73cc3475bd), #11297
- Improved
sprintf()inference (#3232), thanks @staabm! - Print elapsed analysis time with
-v(#3239, #3242), thanks @janedbal! - More precise
sprintf()format arg-based return type (#3192), #11248, #10493, thanks @staabm!
Bugfixes 🐛
- Fix return type of round/ceil/floor in non strict type environment (#3223), #11319, thanks @BackEndTea!
- Fix statement analysis after early-terminating statements (#3227), #11179, thanks @takaram!
- Fix match of union of enums (https://github.com/phpstan/phpstan-src/commit/44e40f054569f3eeed81280bf0d2f50659fb1056), #11313
- Fix
pathinfo()return type for union type flags (#3120), #10760, thanks @staabm! - Fix and simplify discovering composer autoloader project path (https://github.com/phpstan/phpstan-src/commit/2cc6cda6969a63267e70c2074efa0477b69c9083)
- Ignore non-explicit NeverType in purity check (#3243), #11207, thanks @staabm!
- Non-numeric strings in
pow()lead to error (#2796), #10125, thanks @staabm! - Closure with by-ref parameter is impure (https://github.com/phpstan/phpstan-src/commit/f1abacddb3787ce279e51b1f88f1543d52b9759c), #11361
- PathRoutingParser - check if the file is a symlink that might be in analysed paths (https://github.com/phpstan/phpstan-src/commit/c9a6d2e61edfad189a765df3c3a06674a10d4fb5), #6585
Function signature fixes 🤖
Internals 🔍
- Indicate file on TypeInferenceTestCase validation errors (#3166), thanks @staabm!
- nette/di - patch for PHP 8.4 support (https://github.com/phpstan/phpstan-src/commit/1245ea73e5a24aefc4fac87ebe73d9720deac7c9)
- InternalError is part of
@api(#3240), thanks @janedbal! - Refactor RegexArrayShapeMatcher (#3248), thanks @staabm!
- Refactor PrintfParametersRule (#3247), thanks @staabm!
- Simplify RegularExpressionPatternRule (#3251), thanks @staabm!
- Copy regex grammar from hoa/regex into the project (https://github.com/phpstan/phpstan-src/commit/bacb3c6d11edb5f30176e70ade6e72ac4f2e23dd)
- Apply Grammar.patch to reflect previous phpstan state (https://github.com/phpstan/phpstan-src/commit/e71cff468aa4695e9bfa09d01e0ec5194890e7f1)
- ExecutionEndNode always has a statement (https://github.com/phpstan/phpstan-src/commit/27e0f91efad4c9fcacae98b2e3394c069e9e5095)
- Fix PHP_VERSION_ID comparison in test (#3254), thanks @staabm!
- Apply the stricter signatures for PHP 8.0 after the basic ones for PHP 8.0 (#3259), thanks @thg2k!
- Refactor function signature map files loading (#3262), thanks @thg2k!
v1.11.7
Improvements 🔧
- Rework
matchexpression analysis with enum with performance in mind (https://github.com/phpstan/phpstan-src/commit/b98abe01ca2a589c964970ea42128ae9b752890b), #11263 - DiagnoseExtension (https://github.com/phpstan/phpstan-src/commit/d55933fa0c8d6c9d91c5d30f70313e1c15b2c7f9)
- This extension can output any diagnostic information to stderr after analysis
- PHPStan displays this information when running the "analyse" command with
-vvvCLI option.
- Result cache - debug message about successfully restored cache (https://github.com/phpstan/phpstan-src/commit/979055fceeaefec30c1eded52550012f0c1333b6)
- Show a hint about
-vvfor unignorable errors when generating the baseline (https://github.com/phpstan/phpstan-src/commit/d931c8987563fbe5a05e411722a6f53da6f1b555), #3973 - Limit the depth when resolving closure type for performance reasons (https://github.com/phpstan/phpstan-src/commit/2c08dfa8d0f975654d52fe279a950c54415076b5?w=1), #11283
-
MutatingScope::resolveType()- cache closure body analysis data (https://github.com/phpstan/phpstan-src/commit/fd3115652b76278fa6ddf8ba40b41fc751642153), #11283
Bugfixes 🐛
- Observe
@no-named-argumentsabove class (https://github.com/phpstan/phpstan-src/commit/815270d8933b9cdefa4613f0baf17bcbff91be6f), #11275 - Fix
count()narrowing on $matches (#3210), #11277, thanks @staabm! - Try preventing "Method was not found in reflection of class" when getting a method prototype (https://github.com/phpstan/phpstan-src/commit/25658f64f0bcfe784893104864d92032cce33e96), #11269, #11251
- RegexArrayShapeMatcher - support resetting non-capturing groups (#3212), #11291, thanks @staabm!
- Prevent out-of-memory errors while regex array shape inference (#3213), #11292, thanks @staabm!
Function signature fixes 🤖
-
getimagesize,getimagesizefromstring: zero is a possible value for height and width (#3207), thanks @mfruehauf!
Internals 🔍
- Faster
ObjectType::getEnumCases()(#3203, #3204), #11263, thanks @staabm! - Update composer-dependency-analyser to 1.6.0 (#3205), thanks @janedbal!
v1.11.6
v1.11.5
Bleeding edge 🔪
- Check array functions which require stringish values (#3132), #11141, #5848, #3694, #11111, thanks @schlndh!
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. Learn more
Improvements 🔧
- When internal errors occur, do not show other reported errors (https://github.com/phpstan/phpstan-src/commit/aa921137be5b510408bc8df9b8b6fe632ed09db5)
- It's important to first solve internal errors before seeing other reported errors
- Inspired by https://github.com/phpstan/phpstan/discussions/11107 (ReviewDog was eating up important errors)
- Show internal errors nicely in PHPStan Pro
Bugfixes 🐛
- Fix bug in
get_debug_type()DynamicFunctionReturnTypeExtension (#3128), thanks @patrickkusebauch! - Include path when counting errors ignored by identifier (#3154), #11177, thanks @pilif!
- Implement bit shift operation on integers and unions (#3145), thanks @thg2k!
- Fix division type result with even integer range (#3152), thanks @thg2k!
- Solve identical comparison bug in call-site variance (#3153), #11161, #10697, thanks @VincentLanglet!
Function signature fixes 🤖
-
gnupg_init()optionsparameter is optional (#3129), thanks @yphoenix! - Update outdated
RedisCluster::__constructsignature (#3130), #11158, thanks @wolfgangzwiauer! - Improve image related functions signature (#3127), thanks @thg2k!
- Update/fix ext-amqp signatures (#3139), thanks @ben-challis!
- fix
AMQPQueue::unbind()routingKey type (#3143), thanks @ben-challis! - Add parameter definitions to
AMQPQueue::consume()callback (#3144), #9445, thanks @ben-challis! - Add int ranges to AMQP typings (#3146), thanks @ben-challis!
- Various fixes to the return signature of
IntlDateFormattermethods (#3149), thanks @chosten! - Fix
Exception::getTrace()return type (https://github.com/phpstan/phpstan-src/commit/492cd89932d873147cdf7acf49c88d432cbce69f) - fix posix_getpwuid (#3157), thanks @pistej!
Internals 🔍
- Regression test (#3136), thanks @staabm!
- Relax test version restriction (#3140), thanks @thg2k!
- Fix
PrepareCommand::fixComposerJson()(https://github.com/phpstan/phpstan-src/commit/4537ef1445b910930afa32d7fd8f22b044fdc726) - Internal errors as structured objects (https://github.com/phpstan/phpstan-src/commit/7cd03f02a5c32ca4e51006dc21d6184f73835a14)
- WorkerCommand - do not return exit code 1 in case of internal errors, they are handled anyway (https://github.com/phpstan/phpstan-src/commit/f76d836d13fb94e9887260ae18229ad2ca2ce2ce)
- NodeScopeResolverTest - remove requires (https://github.com/phpstan/phpstan-src/commit/f6b989881e66445197f6526bfcde868a60472098)
- Fix discrepancy between
lint >=andPHP_VERSION_IDin NodeScopeResolverTest (https://github.com/phpstan/phpstan-src/commit/b530b0d53d3fc990dcb0225e0d997af06ee15180) -
TypeInferenceTestCase::gatherAssertTypesFromDirectory()(https://github.com/phpstan/phpstan-src/commit/595de78d35124d00eed90c09f5fd73cb40351e02) - Take advantage of gatherAssertTypesFromDirectory in NodeScopeResolverTest (#3159)
- Turn TraitsCachingIssueIntegrationTest into a e2e test (#3151), thanks @staabm!
v1.11.4
Improvements 🔧
- Detect
--generate-baselinecombined with--pro(https://github.com/phpstan/phpstan-src/commit/dd028cb4ccc44c6aa12b51f443e8761d5d4efc1d), #11093 - Add error identifier to RawErrorFormatter (#3112), #11125, thanks @zonuexe!
- Pass current rule level to PHPStan Pro (https://github.com/phpstan/phpstan-src/commit/7af14fbfc027b15e3342ac95be783bd3fa1df413)
- Read and enforce PHPStan version constraints from
phpstan/extension-installerv1.4 (https://github.com/phpstan/phpstan-src/commit/1d005ef1e72f77afada37bad491f2b6602f4cc92)
Bugfixes 🐛
- Consider
numeric-stringtypes after string concat (#3117), thanks @staabm! - Fix type loss with recursive
count()(#2812), thanks @staabm! -
array_slice()returnsnon-empty-arrayfor existing offsets and positive limit (#3124), #10721, thanks @staabm! - Consider a
ClosureType()as maybe impure by default when no$impurePointsarray provided (#3125), #11135, thanks @jf-m!
Function signature fixes 🤖
- Make the return type of
tempnam()andtmpfile()to benevolent union (#3111), thanks @zonuexe! - Fix
gnupg_initfunction (#3118), thanks @pistej!
Internals 🔍
- Update
react/promise(https://github.com/phpstan/phpstan-src/commit/da754e2294a619bacc95cd42426e94c17a57365b)
v1.11.3
Improvements 🔧
- Add new
*ParameterClosureTypeExtension(#3089), thanks @canvural! - DynamicFunctionReturnTypeExtension for the
get_debug_typefunction (#2910), #10558, #10585, thanks @patrickkusebauch! - Infer more duplicated array keys (#3058), #6976, thanks @VincentLanglet!
- Improve
explodereturn type precision (#3096), thanks @staabm! - Make assigning property via reference impure (#3082), thanks @schlndh!
- Support new PHP 8.4 mb_lcfirst, mb_ucfirst function variants (#3095), thanks @staabm!
Bugfixes 🐛
- Make
array_mapargument take into account unpack (#2901), #10527, thanks @ryium! - Fixes incorrect types reported by
parse_url(#2918), #4754, thanks @ChrisBrenton! - Ensure
$http_response_headeris alist<string>(#2959), thanks @Seldaek! - Keep numeric-strings in
str_repeat()(#2914), #10572, thanks @staabm! - Array is non-empty even when
in_arrayis not strict (#2539), #9662, #10228, thanks @staabm! - Fix
substr()type narrowing for possibly single char result (#3081), #11035, #9804, thanks @staabm! - Fix escaping of the error message in various output formatters (#3087), thanks @mousetail!
-
$thiscannot be reassigned when passed by reference (#3097), #10477, thanks @takaram! - Subtract zero-float when comparing against zero-int (#3102), #5309, thanks @staabm!
- Fix fatal error on
constant('')(#3013), #10867, thanks @staabm!
Function signature fixes 🤖
- Add new header functions for PHP 8.4 (#3093), thanks @Seldaek!
- Fix wrong return type for
SplFileObject::fgets()(#3103), thanks @DanielSiepmann! - Update
Localesignatures (#2880), #7855, #8149, thanks @devnix! - Fix wrong
fread()length parameter type and return type (#3105), thanks @thg2k! - ReflectionFunction and ReflectionMethod::getClosure cannot return null (https://github.com/phpstan/phpstan-src/commit/dae9335075964f197aa5d965b3d38c12788a6405), #10839
- Make method names
non-falsy-string(#3108), thanks @schlndh!
Internals 🔍
- Add regression test (#3066), #3300, thanks @herndlm!
- Update phpdoc-parser (#3107)
-
TemplateTagValueNode::$namecannot be empty string (https://github.com/phpstan/phpdoc-parser/commit/fcaefacf2d5c417e928405b71b400d4ce10daaf4), thanks @staabm!
-
- Fix property descriptions in ReflectionProviderGoldenTest (#3109), thanks @schlndh!
v1.11.2
Improvements 🔧
- Stricter
@phpstan-ignoreidentifiers parser (#3079, #3090, #3091), thanks @janedbal!- The parser now rejects some syntax that was possible but undocumented in 1.11.0 and 1.11.1
- The parser now allows to attach comment to each single identifier in a list:
@phpstan-ignore identifier (comment), identifier2 (comment2)
- Resolving type of closure - get
$passedToTypefrominFunctionCallsStack(https://github.com/phpstan/phpstan-src/commit/ca41b7d8c2d54407156d07dab5375a3a5ebbeb29, https://github.com/phpstan/phpstan-src/commit/da4fd7a4122615d9dbae55083bdfd290026fa08e), #5508, #10254, #10732 - Do not lose generic type when the closure has native return type (https://github.com/phpstan/phpstan-src/commit/7e9cd45701562fb02f1aa9cab1f89b58a58f6526), #9086
Function signature fixes 🤖
Internals 🔍
- Fix Composer by referencing deleted tag of
nette/di(https://github.com/phpstan/phpstan-src/commit/2ab647e12fe46d970fa630b78f9ca962354b3d16) - Specify
array_filtercallbacks (https://github.com/phpstan/phpstan-src/commit/754b7b8e170cd36ed7bc8633b90651eff16cc893) - Add
@apiannotation toAcceptsResult::__construct(#3092), thanks @canvural!
v1.11.1
Improvements 🔧
Bugfixes 🐛
- Do not complain about
impure(Function|Method).pureif it has@phpstan-asserttags (https://github.com/phpstan/phpstan-src/commit/9544f8a6b52dbd6068800bbfc5bdaf67fe04a8c2) - Remove tip about deprecated config option (https://github.com/phpstan/phpstan-src/commit/d603c7b676e3b91f4b7ba81d46aee3e9a593f883), #11000
- Fix false positive with
reportPossiblyNonexistentConstantArrayOffset: true(https://github.com/phpstan/phpstan-src/commit/5277630459518024b16272bf6b6fd216eb3d10ed), #10997 - Fix parent keyword case sensitivity (#3064), thanks @staabm!
- InlineHTML is an impure point (#3072), thanks @staabm!
- UnionTypeHelper - prevent infinite recursion (https://github.com/phpstan/phpstan-src/commit/bb3da26d562727c3122a344622059ded2239d6ab), #11027
- Fix more potential for infinite recursion (https://github.com/phpstan/phpstan-src/commit/1d02c4f27684644e8361cf2a2bc5713adef9b95e)
- RangeFunctionReturnTypeExtension - fix internal ValueError (https://github.com/phpstan/phpstan-src/commit/fe3895ada98940d1a71c2eb115d61afda9fd7a2c), #11026
- Property unset is an impure point (https://github.com/phpstan/phpstan-src/commit/702ddcd7805ba08c0765bdf0930beaef0e6b4fc1), #11001
- Fix property assign not being an impure point in arrow function (https://github.com/phpstan/phpstan-src/commit/35ff6895f48b74e8bc0dda7ec94c40e73c84099b), #11001
- Fix internal error when accessing enum case by class-string (https://github.com/phpstan/phpstan-src/commit/1116e03389f0f47297c2638b5b67c84f4d339478), #10985
- Fix resolving
selfandstaticin@phpstan-closure-thisfrom trait stub file (https://github.com/phpstan/phpstan-src/commit/93402494ee92dd2e7264f112105151586203e0ec), #11009 - CallToMethodStatementWithoutImpurePointsRule - fix for methods called on unions (https://github.com/phpstan/phpstan-src/commit/ee33f1e48b5ae9d6e99500814c186cd31e7a764f), #11011
Function signature fixes 🤖
- Offset
uriinstream_get_meta_datacalls is always present on PHP 8.3+ (https://github.com/phpstan/phpstan-src/commit/885d46bc8d7555a8b762914821ad2f0f5871e517), #11024, #10999
v1.11.0
Read the article about PHPStan 1.11 on phpstan.org »
Major new features 🚀
-
Error identifiers
- A way to categorize reported errors by a stable identifier. Up until now you had to use specific and ever-changing error messages
- Can be used for ignoring specific errors locally with new
@phpstan-ignorecomment (uses current or next line automatically) - Can be used for ignoring specific errors in
ignoreErrorssection of your configuration file (phpstan.neon) - Can be used in output formatters
- Can be seen in PHPStan Pro GUI or in TableErrorFormatter with
-v - Catalogue with source code links: https://phpstan.org/error-identifiers
-
PHPStan Pro Reboot
- A new migration wizard will effortlessly migrate all your
@phpstan-ignore-lineand@phpstan-ignore-next-lineto the new@phpstan-ignorecomment style with error identifiers. The old comment style is dangerous because it ignores all errors, current and future, on that line. - Revamped UI for much more comfortable viewing and browsing of reported errors
- The new UI also lets you browse ignored errors, from
ignoreErrors, from your baseline and also ignored locally in source code using comments - Streaming errors during launch: You don't have to wait for the analysis to complete, you can see errors as they come in during the analysis
- Support for mapping file paths to the host filesystem when running in Docker or remotely
- Try it out by running PHPStan with
--proCLI option
- A new migration wizard will effortlessly migrate all your
- PHPDoc tags describing callable lifecycle:
@param-immediately-invoked-callable,@param-later-invoked-callable- Useful for exception analysis (https://phpstan.org/blog/bring-your-exceptions-under-control) and
@phpstan-pure
- Useful for exception analysis (https://phpstan.org/blog/bring-your-exceptions-under-control) and
- PHPDoc tag
@param-closure-thisto describe what$thisis bound to in a passed closure - Two new config options around stricter offset checks in arrays (#3028), #7553, thanks @ttomdewit!
-
reportPossiblyNonexistentGeneralArrayOffset -
reportPossiblyNonexistentConstantArrayOffset - Learn more in the documentation
-
Bleeding edge 🔪
- Checking truthiness of
@phpstan-pureabove functions and methods - Check
new/function call/method call/static method call on a separate line without any side effects even without@phpstan-purePHPDoc tag on the declaration side - BetterNoopRule - take advantage of impure points (https://github.com/phpstan/phpstan-src/commit/a6470521b65d7424f552633c1f3827704c6262c3), #10389
- Run missing type check on
@param-out(https://github.com/phpstan/phpstan-src/commit/56b20024386d983927c64dfa895ff026bed2798c) - CallToConstructorStatementWithoutSideEffectsRule - report class with no constructor (https://github.com/phpstan/phpstan-src/commit/b116d25a6e4ba6c09f59af6569d9e6f6fd20aff4)
- Deprecated: returning plain strings as errors, use RuleErrorBuilder
- Deprecated: returning RuleError without identifier (https://github.com/phpstan/phpstan-src/commit/969e6fa31d5484d42dab902703cfc6820a983cfd)
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. Learn more
Improvements 🔧
- Generic RuleErrorBuilder (https://github.com/phpstan/phpstan-src/commit/9a3ed85178097e2d74f27623dd02bdd72c571e5b)
- Deprecate
checkMissingIterableValueType: falseandcheckGenericClassInNonGenericObjectType: falsein favour of ignoring via identifiers (https://github.com/phpstan/phpstan-src/commit/a64998108b318581b0203e84582711c3e4d1e43c) - Deprecate old NoopRule - replaced by BetterNoopRule in bleeding edge (https://github.com/phpstan/phpstan-src/commit/109083571de6102cb854b9975c1463551ef678d0)
- Allow ignoring errors from CollectedDataNode with local comments (https://github.com/phpstan/phpstan-src/commit/dc3b75ab4a2acd863405416620240302b284973a)
- Introduce
newtype (#3050), #9704, thanks @ruudk! - RuleTestCase - fail on PHP warnings, notices etc. (#3030), thanks @janedbal!
- Check duplicate assignment of redeclared promoted readonly properties (#3049), #8101, #9863, #9864, thanks @schlndh!
- Remove line from "nikic/php-parser" error message (#2845), thanks @mvorisek!
- Stub validator - PHPStan classes are known without extra stubs (https://github.com/phpstan/phpstan-src/commit/d004c239677fb7abe41aa16e8e1b45bfac63f773)
- Stub validator - PhpParser classes are known without extra stubs (https://github.com/phpstan/phpstan-src/commit/3e498e1592221f3a01527c10318424014d52f85d)
- CheckstyleErrorFormatter - include error identifier in source attribute (https://github.com/phpstan/phpstan-src/commit/f66cf5badd2c98317d1d296ba24c3be77efcda18), #1205
- BaselinePhpErrorFormatter - error identifiers in comments (https://github.com/phpstan/phpstan-src/commit/4b32cac2d1b98c6af65c07041fdbc64e5d3f3baf)
-
RuleErrorBuilder::file()- file path needs to exist (https://github.com/phpstan/phpstan-src/commit/c453f29f60992167a5aa46d4926c18a420ae7b26) - AbstractMethodInNonAbstractClassRule - better error message for enums (https://github.com/phpstan/phpstan-src/commit/b5dd34e492b03566458e98b314c6852cfd683916)
- Fixed Xdebug spelling (#2746), thanks @derickr!
- Track invalidated
$thisand used variables after invoking closure (#2980) - Support
@phan-prefixes on recognized PHPDoc tags (#3000), thanks @anomiex! -
pure-callableandpure-ClosurePHPDoc types (https://github.com/phpstan/phpstan-src/commit/cdaff5f00d621c3a94e048b8bd9fa864d47b3228) -
highlight_string()flips side-effects depending on $return (#3021), thanks @staabm! - Improve types for predefined constants (#3054), thanks @zonuexe!
Bugfixes 🐛
- Make
AccessoryNonFalsyStringType::toInteger()returnIntegerTypeinstead of non-zero (#3018), #10893, thanks @zonuexe! - Filter scope by non-empty array after foreach regardless of
polluteScopeWithAlwaysIterableForeach(#3029), #10922, thanks @VincentLanglet! - Preserve large arrays with same keys through union (#3032), #9397, #10080, thanks @schlndh!
- Fix
count($x) > $n === truenegation (#3037), #10952, thanks @rvanvelzen! - Fix NAN not accepting NAN (#3036), #10956, #10297, thanks @rvanvelzen!
- DateTimeInstantiationRule - fix error message for
newwith wrong name case (https://github.com/phpstan/phpstan-src/commit/59ac31a554203a7ae3fb9449bbd5b61f3afe2e20) - Process ConstFetch (https://github.com/phpstan/phpstan-src/commit/b5c63c296783bd067b14bad410dab2b87a1b7b3c)
- Fix
preg_match_allbehaviour with no flags (https://github.com/phpstan/phpstan-src/commit/a856ec7ab5540cb4a8d30e9e170958a32a7165b2) -
file_get_contentsis an impure function (https://github.com/phpstan/phpstan-src/commit/2b5b3174c7f00e56b7692b4c26552b2ad13c73d5) - Fix
ClosureType::equals()(https://github.com/phpstan/phpstan-src/commit/29c35b584a948e9a3c90e2d56312069ce073e6e6) - Use statement result of analysed anonymous class to inform about throw points and impure points (https://github.com/phpstan/phpstan-src/commit/70a75f68896e5f7eaa988c0cb7f20dad32c3c172)
- Filter out implicit throw points from callables when
exceptions.implicitThrows: false(#3016), thanks @janedbal! - Fix
ConstantArrayType::hasOffsetValueType()for offset union type where all types are valid (https://github.com/phpstan/phpstan-src/commit/26e949b0d093751c98e9a106f680092abf3b28d9) -
non-empty-listalways has offset 0 (https://github.com/phpstan/phpstan-src/commit/f4d1d481472b45c56ba2cd49ae98065092217f36) - Narrow to
non-empty-string/non-falsey-stringaftermb_strlen()(#3038), thanks @staabm! - Implement
Type::isOffsetAccessLegal()to detect offset access that crashes even inisset()(#3045), #8393, #10926, thanks @rajyan! - Specify types on
match()condition correctly (#3053), #10974, #9694, thanks @rvanvelzen! -
json_decodewith force array flag: subtract all objects, not just stdClass (#3052), thanks @rajyan! - Fix
strlen($x) > $n === truenegation (#3040), thanks @staabm! - Support multi-byte string function variants (#3039), thanks @staabm!
- Final scope from
Continue_points should not be used forwhile (true)(#3057), #10980, thanks @greew! - Fix enum performance problem (#3062, #3060), #10979, thanks @staabm!
- NULL and null as a property default value are treated differently when overriding a parent property (#3063), #10987, thanks @staabm!
Function signature fixes 🤖
- Make the url key of metadata returned by
stream_get_meta_data()optional (#3024), #10887, thanks @hirokinoue! - Narrow
Closure::bind$newScopeparam (#2817), thanks @mvorisek! - Infer object type mysqli_fetch_object (#2675) (#2675), thanks @staabm!
- Fix
Imagick::identifyImage()return type (#3017), thanks @SVillette!
Internals 🔍
- Clean up old identifiers and metadata (https://github.com/phpstan/phpstan-src/commit/c476a8611d06ed5ce850ba74bd087ed0fa9304ad)
- Delete StatementOrderVisitor that is no longer needed (https://github.com/phpstan/phpstan-src/commit/017d321f47b2a49c11b0337a920235b0770da164)
- Introduce
ClassReflection::getClassTypeDescription()(https://github.com/phpstan/phpstan-src/commit/dec9e435a7e0cea96079eb08c799df6b49b92e82) - Fix classname typo in tests (#2461), thanks @szepeviktor!
- Fix various typos (#2463), thanks @szepeviktor!
- Added text regarding patch issues during installation (#2670), thanks @mt-satak!
- Fix typo in ArgumentsNormalizer (#2705), thanks @mad-briller!
- Rich PHPDoc for ExceptionTypeResolver (https://github.com/phpstan/phpstan-src/commit/e7ab4f741c0ec22cf70457c7a542b7978202b10a)
- Hide internal commands (#2833), thanks @rvanvelzen!
- Test invalidated object in static closure (#2981), thanks @staabm!
- PHPDoc: address multiple variables defined in one @param (#3001), thanks @Muqsit!
- Do not assume every contributor uses PhpStorm (https://github.com/phpstan/phpstan-src/commit/d1834e69d06e0f85a45db8f5fb7a2c5a6ce898b6)
- TypeInferenceTestCase: ability to disable implicit throws (#3015), thanks @janedbal!
- Slightly reduce comparing and calling methods for trivial optimizations (#3004), #10926, thanks @zonuexe!
- AnalyserResultFinalizer - DRY of running CollectedDataNode rules (https://github.com/phpstan/phpstan-src/commit/38e2c96ee45733c8d3b44d048ce27a9b5450718e)
- Introduce LocalIgnoresProcessor (https://github.com/phpstan/phpstan-src/commit/d026655260727c7c6e4cd69d50d57569e9128c13)
- Introduce
RuleErrorBuilder::treatPhpDocTypesAsCertainTip()for a bit more DRYness (#3035), thanks @axlon! - Make ResultCacheEndToEndTest pass level 9 (#3055), #10977, thanks @AJenbo!
- ClassReflection - cache enum cases (https://github.com/phpstan/phpstan-src/commit/39ce0425737cdbacfee5fbc08160d023cb5bc639), #10979
v1.10.67
This is the last release, or one of the last releases, in 1.10.x series. The next one is going to be PHPStan 1.11, and it's going to be released at some point in May 2024.
Improvements 🔧
- Forbid PHPUnitPHAR prefixed classes (#3002), thanks @staabm!
- Improve error messages on unnamed parameters (#3010), #10814, thanks @takaram!
Bugfixes 🐛
- Improve
date()return types (#2888), #10468, #6613, thanks @zonuexe! - Default value null does not make promoted property type nullable (https://github.com/phpstan/phpstan-src/commit/b2177e350f79176a5d53eaf75e37e5dce0053f8a), #9839
- Fix socket_select array types after call (https://github.com/phpstan/phpstan-src/commit/24c52494be982429eb6782ad859fb6cbd6fb3dee), https://github.com/phpstan/phpstan/discussions/10285
- Fix conditional types in PHPDocs from stubs for native functions (https://github.com/phpstan/phpstan-src/commit/8ae0b28a5c1e6f4e2c692caff0cd99df07f2486e)
- Fix env int key problem (https://github.com/phpstan/phpstan-src/commit/e606fbedaea7e887456a771ce0dbb9572d16accf), #10833
- Fix false positives about uninitialized properties (#2897), #10523, #10822, thanks [@staabm](https://togithub.com/staa
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.71%. Comparing base (
c6e32b2) to head (602a6f2). Report is 12 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #39 +/- ##
============================================
+ Coverage 94.03% 98.71% +4.67%
- Complexity 142 150 +8
============================================
Files 10 10
Lines 369 388 +19
============================================
+ Hits 347 383 +36
+ Misses 22 5 -17
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.