Phpstan Versions Save

PHP Static Analysis Tool - discover bugs in your code without running it!

1.11.0

2 days ago

Read the article about PHPStan 1.11 on phpstan.org ยป

Major new features ๐Ÿš€

  • 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
  • PHPDoc tags describing callable lifecycle: @param-immediately-invoked-callable, @param-later-invoked-callable
  • 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!

Bleeding edge ๐Ÿ”ช

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 ๐Ÿ”ง

Bugfixes ๐Ÿ›

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 ๐Ÿ”

1.10.67

4 weeks ago

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 ๐Ÿ›

Function signature fixes ๐Ÿค–

  • More precise gc_status() signature for PHP8.3+ (#2996), thanks @staabm!
  • Add object shape for mysqli_result::fetch_fields (#3005), thanks @schlndh!

Internals ๐Ÿ”

  • composer-dependency-analyser: update to 1.5.0 (support functions) (#3011), thanks @janedbal!

1.10.66

1 month ago

Improvements ๐Ÿ”ง

Bugfixes ๐Ÿ›

Function signature fixes ๐Ÿค–

  • Fix redis::get signature (#2990), thanks @VincentLanglet!

Internals ๐Ÿ”

  • Prevent unnecessary calls into reflection from JSON extensions (#2994), thanks @staabm!

1.10.65

1 month ago

Improvements ๐Ÿ”ง

  • Fix slow enum cases union with lots of cases (#2985), #10772, thanks @staabm!

Bugfixes ๐Ÿ›

Function signature fixes ๐Ÿค–

  • Add benevolent union return types (#2986), thanks @zonuexe!

Internals ๐Ÿ”

1.10.64

1 month ago

Bleeding edge ๐Ÿ”ช

  • Fail build when project config uses custom extensions outside of analysed paths
    • This will only occur after a run that uses already present and valid result cache

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 ๐Ÿ”ง

Bugfixes ๐Ÿ›

  • Fix deprecated parameter order (#2971), thanks @sayuprc!

Function signature fixes ๐Ÿค–

  • Fix DOMDocument::load return type (#2975), thanks @VincentLanglet!
  • Fix SplObjectStorage::removeAll/Except (#2892), thanks @schlndh!

1.10.63

1 month ago

Improvements ๐Ÿ”ง

Bugfixes ๐Ÿ›

Function signature fixes ๐Ÿค–

  • Add false return type to exec() (#2974), thanks @VincentLanglet!

Internals ๐Ÿ”

  • Cleanup AnalyserIntegrationTest->runAnalyse() (#2960), thanks @staabm!
  • ReflectionProvider::hasClass() narrows $className arg (#2976), thanks @staabm!

1.10.62

2 months ago

Improvements ๐Ÿ”ง

Bugfixes ๐Ÿ›

1.10.61

2 months ago

Improvements ๐Ÿ”ง

Bugfixes ๐Ÿ›

Internals ๐Ÿ”

1.10.60

2 months ago

Learn more about this release in an article on phpstan.org!

Major new features ๐Ÿš€

  • Generic @method tags: @method T doFoo<T>(T $p), #6371
  • Generic callable types: callable<T>(T): T, #8964
  • Error on references of prefixed internal class names from PHAR files (#2932), thanks @staabm!

Bleeding edge ๐Ÿ”ช

  • Enhancements in Handling Parameters Passed by Reference
  • Add option reportAnyTypeWideningInVarTag (#2840), thanks @janedbal!

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 ๐Ÿ”ง

  • Add support for constructor assertions (#2950), #10645, thanks @axlon!
  • Report uses of deprecated constants (#2953), thanks @staabm!

Bugfixes ๐Ÿ›

Function signature fixes ๐Ÿค–

Internals ๐Ÿ”

  • Replace composer-require-checker with composer-dependency-analyser (#2875), thanks @janedbal!
  • Use Type::isNull() in Nullsafe(MethodCall|PropertyFetch)Rule (#2942), thanks @takaram!

1.10.59

2 months ago

Bleeding edge ๐Ÿ”ช

  • array_values rule (report when a list type is always passed in) (#2917), thanks @kamil-zacek!

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 ๐Ÿ”ง

Bugfixes ๐Ÿ›

Internals ๐Ÿ”