Update PHPStan packages
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
phpstan/phpstan | require-dev | minor |
1.10.67 -> 1.11.1
|
phpstan/phpstan-symfony | require-dev | minor |
1.3.12 -> 1.4.0
|
Release Notes
phpstan/phpstan (phpstan/phpstan)
v1.11.1
🔧
Improvements
🐛
Bugfixes - Do not complain about
impure(Function|Method).pure
if it has@phpstan-assert
tags (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
self
andstatic
in@phpstan-closure-this
from 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
uri
instream_get_meta_data
calls 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-ignore
comment (uses current or next line automatically) - Can be used for ignoring specific errors in
ignoreErrors
section 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-line
and@phpstan-ignore-next-line
to the new@phpstan-ignore
comment 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
--pro
CLI 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-this
to describe what$this
is 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-pure
above functions and methods - Check
new
/function call/method call/static method call on a separate line without any side effects even without@phpstan-pure
PHPDoc 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: false
andcheckGenericClassInNonGenericObjectType: false
in 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
new
type (#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
$this
and used variables after invoking closure (#2980) - Support
@phan-
prefixes on recognized PHPDoc tags (#3000), thanks @anomiex! -
pure-callable
andpure-Closure
PHPDoc 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()
returnIntegerType
instead 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 === true
negation (#3037), #10952, thanks @rvanvelzen! - Fix NAN not accepting NAN (#3036), #10956, #10297, thanks @rvanvelzen!
- DateTimeInstantiationRule - fix error message for
new
with wrong name case (https://github.com/phpstan/phpstan-src/commit/59ac31a554203a7ae3fb9449bbd5b61f3afe2e20) - Process ConstFetch (https://github.com/phpstan/phpstan-src/commit/b5c63c296783bd067b14bad410dab2b87a1b7b3c)
- Fix
preg_match_all
behaviour with no flags (https://github.com/phpstan/phpstan-src/commit/a856ec7ab5540cb4a8d30e9e170958a32a7165b2) -
file_get_contents
is 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-list
always has offset 0 (https://github.com/phpstan/phpstan-src/commit/f4d1d481472b45c56ba2cd49ae98065092217f36) - Narrow to
non-empty-string
/non-falsey-string
aftermb_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_decode
with force array flag: subtract all objects, not just stdClass (#3052), thanks @rajyan! - Fix
strlen($x) > $n === true
negation (#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
$newScope
param (#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
phpstan/phpstan-symfony (phpstan/phpstan-symfony)
v1.4.0
- 51183fe - Update lock-closed-issues.yml
- f4b9407 - Synchronize stub with symfony
- 3fbf634 - Synchronize stub with symfony
- 99848d8 - Add stub for Compound::getConstraints()
- 8148308 - Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- c9f5ceb - Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- 67e208d - Add documentation to load DI helper
- a0e0f1f - chore(deps): update metcalfc/changelog-generator action to v4.3.1
- b2ddd0f - chore(deps): update cbrgm/mastodon-github-action action to v2
- 3b3083d - Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- 4cc4788 - chore(deps): update metcalfc/changelog-generator action to v4.2.0
- 44b68dd - chore(deps): update dessant/lock-threads action to v5
- 5586faa - Merge branch '1.3.x' into 1.4.x
- b9e1ded - Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- ce3c258 - Error identifiers
- 6a0cefe - Require PHPStan 1.11
- 67cf72e - Open 1.4.x-dev
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.