What's Changed
Removed
- Php version consistency by @orklah in #6898
- Removed TEmpty by @orklah in #6662
- remove support for allowPhpstormGenerics by @orklah in #6705
- remove exitFunctions for Psalm5 by @orklah in #6808
- Drop legacy procedural files by @weirdan in #7270
- Dropped removed config entries by @weirdan in #7272
- Dropped legacy plugin API by @weirdan in #7275
- Dropped deprecated
CodeIssue
methods by @weirdan in #7276 - Dropped deprecated
DocComment
methods by @weirdan in #7278 - Dropped
THtmlEscapedString
by @weirdan in #7285 - Drop orphaned token by @weirdan in #7290
- Bump PHP version to 7.4 by @weirdan in #7291
- Remove forbidEcho by @orklah in #7420
- remove TPositiveInt by @orklah in #7473
- Lock event classes by @weirdan in #7491
- [TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage by @ohader in #7526
Deprecations
Features
- Support PHPStan notation for empty-arrays by @orklah in #7312
- Try to provide literal int types when possible (fixes #6966) by @ricardoboss in #7071
- Allow config to define thread count by @M1ke in #7442
- Contextual type inference for high order function arg by @klimick in #7417
- feat: Handle native intersection types by @petewalker in #7454
- improve support for enum_exists by @orklah in #7404
- Support type annotations for class consts (fixes #942). by @AndrolGenhald in #7123
- Improve class constant static analysis by @AndrolGenhald in #7154
- Add support for references and improve UnusedVariable checks (fixes #7254). by @AndrolGenhald in #7339
- InternalTaintSinkMap: Add
getimagesize
as SSRF sink by @mal-tee in #7504 - Enable extensions based on composer.json instead of those loaded at runtime (fixes #5482). by @AndrolGenhald in #7107
- Dynamic function storage provider by @klimick in #7471
- ❗Allow plugins to modify Config::$fileExtensions early by @ohader in #6789
- [FEATURE] Introduce BeforeStatementAnalysisEvent by @ohader in #7535
- [FEATURE] Allow to intercept adding issue in IssueBuffer by @ohader in #7530
- Ensure all template parameters are specified in all extended|used classlikes by @danog in #7492
- feat: make key-of/value-of usable with non-const arrays by @Patrick-Remy in #7396
Fixes
- Use InvalidScalarArgument only when we can be sure PHP attempts coercion by @muglug in #7188
- Trim baseline selection by @weirdan in #7279
- Prevent NoValue when there is no phpdoc by @orklah in #7399
- create a return type provider for mb_internal_encoding by @orklah in #7437
- Array key exists assert both ways by @orklah in #7449
- [TypeProvider] Provide argument types during FunctionParamsProviderEvent by @veewee in #7394
- Fix stub parent class not loaded. by @AndrolGenhald in #7110
- fix code where the offset was wrong by @orklah in #7463
- reconcile two arrays by intersecting them by @orklah in #7470
- fix error with 0 being considered positive by @orklah in #7487
- Fix crash due to unresolvable constant. by @AndrolGenhald in #7490
- Fix failing case for const analyzer. by @AndrolGenhald in #7503
- Fix side effect when loading config by @AndrolGenhald in #7506
- improve literal inequality with ranges and rework GreaterThan/LessThan assertions by @orklah in #7511
- Remove mic-drop hack from if analysis by @muglug in #7484
- fix some iterator stubs by @orklah in #6970
- Fix for Exception->getCode return type provider by @VincentLanglet in #7525
- Fix empty array by @orklah in #7517
- add back empty keyword by @orklah in #7533
Docs
- Dropped
html-escaped-string
docs by @weirdan in #7281 - Document BC breaks in #7358 by @weirdan in #7360
- Added documentation for baseline files by @ricardoboss in #7429
- Fix documentation for config. by @AndrolGenhald in #7564
- Fix bullet indentation in documentation by @AndrolGenhald in #7565
Internal changes
- Disable PSL (not yet compatible with Psalm 5) by @weirdan in #7269
- Require
@internal
annotation onPsalm\Internal
symbols by @weirdan in #7268 - Dropped deprecated
TypeAnalyzer
methods by @weirdan in #7277 - Moved
getPsalmHelpText()
toCli\Psalm
by @weirdan in #7280 - Replaced deprecated
webmozart/path-util
by @weirdan in #7292 - Indent heredoc by @weirdan in #7294
- Dropped dead code based on PHP_VERSION_ID by @weirdan in #7300
- Apply literal number separator rector by @weirdan in #7299
- Applied NullCoalescingOperatorRector by @weirdan in #7302
- Applied JsonThrowOnErrorRector by @weirdan in #7303
- Applied ListToArrayDestructRector by @weirdan in #7310
- replace
array<never, never>
as a way to detect empty arrays by a dedicated method by @orklah in #7313 - Applied ClosureToArrowFunctionRector by @weirdan in #7315
- Simplify object comparison by @muglug in #7340
- Rename was_static property to is_static to be more accurate by @muglug in #7358
- Add explicit
resolveSymlinks
option for project directories by @dvz in #7163 - Ensure that all entries in test arrays have explicit keys by @muglug in #7386
- TCallableString is non-falsy (0 can't be a functionlike name) by @orklah in #6521
- fix tests by @orklah in #7446
- Use objects, not strings, for assertions by @muglug in #7410
- Nitpicks by @orklah in #7448
- refactor description of types in Atomic by @orklah in #7409
- remove TPositiveInt usage for TIntRange by @orklah in #7472
- Update .gitattributes by @weirdan in #7522
- Fix ExceptionCodeTest provider shape by @weirdan in #7538
New Contributors
- @M1ke made their first contribution in #7442
- @petewalker made their first contribution in #7454
- @mal-tee made their first contribution in #7504
Full Changelog: 4.19.0...5.0.0-alpha1