Releases: vimeo/psalm
Releases · vimeo/psalm
5.21.0
What's Changed
Features
Fixes
- Fix #10552 by @danog in #10572
- Unit test improvements for php-parser 5 by @edsrzf in #10574
- Fix template replacement edge case by @klimick in #10586
- Switch condition order by @edsrzf in #10594
- Partial revert "Fix auto completion by partial property or method" by @issidorov in #10588
- [LSP] Add issue type in description by @weirdan in #10607
- Do not validate callable arguments in lenient contexts by @weirdan in #10601
readgzfile()
is impure by @weirdan in #10600- Allow properties on intersections with enum interfaces by @weirdan in #10599
key_exists()
is an alias forarray_key_exists()
by @weirdan in #10598- Fix language server running with
opcache.save_comments=0
by @weirdan in #10614 - Report
MissingConstructor
for natively typed mixed properties by @weirdan in #10615
Internal changes
- Bump actions/cache from 3 to 4 by @dependabot in #10584
- Baseline update by @jorgsowa in #10593
- Re-work CheckTrivialExprVisitor by @edsrzf in #10612
- Minor php-parser tweaks by @edsrzf in #10605
New Contributors
Full Changelog: 5.20.0...5.21.0
5.20.0
5.19.1
What's Changed
Fixes
- Deprecated Template Classes are not ignored by @psalm-suppress DeprecatedClass by @samlitowitz in #10518
- Implement __set method in SimpleXMLElement stub by @kthaler in #10536
- Make getrandmax type more specific and unserialize to require class-string by @kkmuffme in #10540
- Fix mb_get_info can return null - CI failing bc of reflection by @kkmuffme in #10543
- make basename & dirname return types more specific by @kkmuffme in #10545
- add support for extract to set variables for keyed arrays and respect EXTR_SKIP by @kkmuffme in #10544
- remove redundat directory separator which caused "//" in path not found errors by @kkmuffme in #10542
- Fix empty literal string becomes non-empty-string by @kkmuffme in #10499
New Contributors
- @samlitowitz made their first contribution in #10518
- @kthaler made their first contribution in #10536
Full Changelog: 5.19.0...5.20.0
5.19.0
What's Changed
Features
- Reduce memory consumption of caching and parallel processing without igbinary by @sj-i in #10532
- filter_input & filter_var return type more specific by @kkmuffme in #10498
Fixes
- strtok always returns a non-empty-string when it does not return false by @kkmuffme in #10497
- Fix #10512: Fixed SessionUpdateTimestampHandlerInterface parameter names by @zerkms in #10524
- Fix GH-10465 by @florisluiten in #10483
- Fix callable without args not handled correctly by @kkmuffme in #10500
- Add error when using readonly property in by-ref arg by @kkmuffme in #10505
- fix: #10496 #10503 by @ging-dev in #10508
New Contributors
- @florisluiten made their first contribution in #10483
Full Changelog: 5.18.0...5.19.0
5.18.0
What's Changed
Features
Fixes
- Fix #10460 by @danog in #10464
- Emit AfterCodebasePopulatedEvent even on partial scans by @danog in #10457
- Small assertion fix by @danog in #10455
- Fix shaped array class string key combination by @danog in #10450
- Fix remaining POSIX-only absolute path detection by @theodorejb in #10452
- dont combine empty string with numeric-string by @kkmuffme in #10459
- Fix type not equal when parent by @kkmuffme in #10477
- Use same parameter names in stubs by @danog in #10480
- fix false positive ArgumentTypeCoercion for callback param by @kkmuffme in #10454
- report error for invalid array key type by @kkmuffme in #10481
- fix literal int/string comparisons only using one literal by @kkmuffme in #10484
- add InvalidArgument error when passing false to true param by @kkmuffme in #10488
- Fix Uncaught RuntimeException: PHP Error: Uninitialized string offset 0 when $pattern is empty by @iMu3ic in #10489
Internal changes
- fix composer scripts running with inconsistent php versions by @kkmuffme in #10463
- update fidry/cpu-core-counter dependency by @kkmuffme in #10456
- fix psalm v4 hardcoded in tests by @kkmuffme in #10475
New Contributors
Full Changelog: 5.17.0...5.18.0
5.17.0
What's Changed
Features
Fixes
- Update MongoDB stubs for 1.17 by @alcaeus in #10402
- Fix backtick analysis by @danog in #10409
- Declare we do not support document highlighting by @tm1000 in #10408
- update define types to be correct by @kkmuffme in #10423
- Fix return type of DOMXPath::query by @nielsdos in #10443
- Fix CLI -r error by @kkmuffme in #10442
- Use correct file path while adding unused suppressions for virtual __… by @danog in #10434
- Restore support for null coalesce on match expressions by @tscni in #10422
- Fix static magic method pureness not being inherited from traits by @tscni in #10429
- Fix POSIX only detection of absolute paths by @rarila in #10441
- Emit UnusedPsalmSuppress issues for suppressed issues already removed by @danog in #10431
- Use keyed arrays when assigning literal union keys & assertion fixes by @danog in #10439
Internal changes
New Contributors
Full Changelog: 5.16.0...5.17.0
5.16.0
What's Changed
Features
- Show success message and type stats with GHA formatter by @weirdan in #10145
- New sinks for TaintedCallable #10117 by @cgocast in #10154
- Properly inherit assertions from parents or implemented faces by @boesing in #10157
- Flag invalid declares by @weirdan in #10176
- Narrow
ArrayObject
TKey
template by @boesing in #10190 - Allow object assertions for
mixed
values by @boesing in #10207 - Issue handlers priority by @gmessier in #10202
- Check for declare strict_types in block mode by @tuqqu in #10234
- feat(LSP): Improve the autocomplete for nested array shape by @ging-dev in #10230
- Add alias support to psalm-check-type by @robchett in #10264
- Allow parameter names in callable docblocks with templates by @robchett in #10261
- Disallow
never
type for parameters by @tuqqu in #10266 - Fix auto completion by partial property or method by @issidorov in #10320
- Add stubs for rdKafka by @robchett in #10351
- Suppressing NoValue should not treat subsequent code as unevaluated by @kkmuffme in #10303
- Fix misc callable bugs by @kkmuffme in #10370
Fixes
- Added more gc_status return fields by @weirdan in #10138
- Filter baseline when checking individual files by @edsrzf in #10115
- Assertion enhancements regarding
value-of
in combination with backed enums by @boesing in #10150 strrchr()
:$before_needle
parameter by @weirdan in #10151- Update
mysqli
stub by @weirdan in #10155 - Fix crash on property access to undefined property on a class with a missing dependncy by @weirdan in #10159
- Prevent infinite-loop when resolving type-aliases by @boesing in #10156
- InheritorViolation was only being triggered on grand-childen classes by @robchett in #10169
- Restore support for namespaced functions in referencedFunction config by @tscni in #10186
DateTimeZone::getName()
always returnsnon-empty-string
by @gsteel in #10187- Only the binary op 'plus' works with two arrays by @robchett in #10209
- Add openssl_*_export_to_file to impure functions by @robchett in #10210
- add FILTER_SANITIZE_URL filter to filter_var by @kkmuffme in #10214
- Allow class-string where T is a union by @MidnightDesign in #10194
- Loop over PDOStatement::fetch() arguments by @cgocast in #10237
- Inherited assertions v2 by @boesing in #10189
- Resolve inherited conditional return types by @boesing in #10191
- Allow stringable objects in
sprintf()
values by @MidnightDesign in #10231 - fix: #10239 by @ging-dev in #10240
- Remove duplicate namespace in InternalMethod error message by @kkmuffme in #10241
- Add stream_socket_shutdown socket_shutdown to impure function list by @tuqqu in #10244
- Emit
MethodSignatureMismatch
when descendant does not return by reference by @tuqqu in #10248 - Negated class_exist check on class-string converts to string instead of mixed by @robchett in #10262
- Fix error message for implicitly returning functions with
never
return type by @tuqqu in #10254 - Type check nested templates by @klimick in #10271
- Fix return of BadSqlTainter::afterExpressionAnalysis() by @cgocast in #10270
- Allow tainted numerics except for 'html' and 'has_quotes' by @cgocast in #10242
- fix final class constant type by @kk-daniel in #10279
- Fix inferring enum case value from a class constant by @tuqqu in #10274
- fix: #10080 by @ging-dev in #10228
- Fix memory explosion with calls to method_exists by @robchett in #10290
- Additional caching fixes by @ging-dev in #10289
- str_replace / substr_replace signature improvements by @mathroc in #10277
- Fix method calls and property accesses after extension_loaded by @danog in #10295
- fix @param-out with named arguments by @kk-daniel in #10312
- Narrow down
get_browser
returning array or object by @simonberger in #10314 - Allow int keys when calling Redis methods by @greg0ire in #10355
- Finding methods and properties for auto completion feature by @issidorov in #10385
- update decimal stubs from documented URL by @kkmuffme in #10379
- Fix Phar build failure by @tscni in #10391
- Fix redundant condition mixed type escape hatch & loose comparison int type shouldnt be mixed by @kkmuffme in #10388
- Fix #10398: add missing methods of ReflectionProperty class in CallMap and CallMap deltas. by @niconoe- in #10399
Docs
- docs: A semicolon expected by @lens0021 in #10149
- Add documentation for @psalm-flow by @ohader in #10349
Internal changes
- Extract the list of impure functions into its own dictionary by @weirdan in #10136
composer.json
tweaks by @weirdan in #10161- Bump actions/checkout from 3 to 4 by @dependabot in #10192
- Update IssueBuffer.php by @aleksandr-shevchenko in #10294
- Backport rector fixes to 5.x by @danog in #10306
- Bump fkirc/skip-duplicate-actions from 5.3.0 to 5.3.1 by @dependabot in #10313
- Allow Symfony 7 by @kbond in #10335
- Get rid of legacy 7.3 logic by @danog in #10319
- Finalize all internal classes by @danog in #10318
- fix CI "split" unevenly splits the number of tests by @kkmuffme in #10389
- Fix circleci builds by @danog in #10396
Other changes
New Contributors
- @lens0021 made their first contribution in #10149
- @kk-daniel made their first contribution in #10279
- @aleksandr-shevchenko made their first contribution in #10294
- @simonberger made their first contribution in #10314
- @kbond made their first contribution in #10335
- @issidorov made their first contribution in #10320
Full Changelog: 5.15.0...5.16.0
5.15.0
What's Changed
Features
- Check if argument passed to isset() is not a variable by @Nitamet in #10068
- Fix #9997 dynamic properties on SimpleXmlElement by @ygottschalk in #10049
- Nicer PHP version checking by @Nitamet in #10129
Fixes
- Fixed
DOMDocument::load*
signatures by @weirdan in #10073 - make (s)printf error reporting more correct/literal by @kkmuffme in #10088
- Fix parameter having
object
type in PHPDoc and only&
in the method's definition, used with code having an object calling it's method with itself as an argument for mentioned parameter by @kubawerlos in #10104 - mysqli_field_seek returns true by @kamil-tekiela in #10107
- Fix bcdiv nullable scale stub by @TheDevick in #10106
- Cleanup
test
command andfixAll
action by @weirdan in #10108 - Correct type for
$enum->name
by @weirdan in #10109 - argv and argc were inconsistent in Context with VariableFetchAnalyzer by @kkmuffme in #10093
- Fix
hash_pbkdf2
$options
parameter by @weirdan in #10110 - Forbid faulty
nikic/php-parser
version by @weirdan in #10112 strip_tags()/$allowed_tags
can accept arrays since 7.4 by @weirdan in #10122- Fix crash when assertion array is not a list by @weirdan in #10123
- Fix crash on array access to undefined class by @weirdan in #10134
- Correct exit code for invalid version format by @weirdan in #10135
New Contributors
- @Nitamet made their first contribution in #10068
- @TheDevick made their first contribution in #10106
Full Changelog: 5.14.1...5.15.0
5.14.1
5.14.0
What's Changed
Features
- Infer output format from GITHUB_ACTIONS env by @ro0NL in #9982
- fix mixed replace return types for arrays by @kkmuffme in #9981
- make stubbed constant types configurable with comment by @kkmuffme in #9992
- Allow space before array shape opening brace and added unit tests by @rhertogh in #10000
- Add generic stubs for MongoDB BSON classes by @alcaeus in #10016
- Allow comments in types (e.g. in array shapes) by @rhertogh in #10004
- #10030 Fix missing TaintedSql by @cgocast in #10032
- Automatic LSP container path mapping by @weirdan in #10033
- added GitHub CI for unit tests with PHP 8.2 and 8.3 by @thbley in #10028
- Modernize LSP progress reporting by @weirdan in #10050
- Add type detection for PDOStatement::fetchAll(PDO::FETCH_CLASS, SomeClass::class) by @thbley in #10055
Fixes
- Fix sprintf single arg splat array by @kkmuffme in #9975
- Fixed exhuming enums as enums, not as classes by @ygottschalk in #9988
- Missing composer lock should not invalidate cache created with missing composer lock by @kkmuffme in #9970
- no error for printf with only 1 arg by @kkmuffme in #9993
- Fix "days" falsable return not ignored consistently by @kkmuffme in #9998
- offsetExists/Get/Set/Unset types were too generic by @kkmuffme in #9999
- Fix inference high order function when closure param is omitted by @klimick in #10014
- Fix incorrect positions set in code action edits by @weirdan in #10034
- Always report UnusedBaseline issues by @ygottschalk in #10012
- Fix scanning of intersection types by @danog in #10043
- Fix combination of non-falsy-string and falsy literal by @danog in #10039
- Fix variadic callable type check by @klimick in #10066
Internal changes
- Fixed psalm self test by @ygottschalk in #9990
- Fix/phpparser deprecation name parts by @ygottschalk in #9964
- Simplify conditions with deep object access by @weirdan in #10037
- Map special RPC paths by @weirdan in #10046
New Contributors
Full Changelog: 5.13.1...5.14.0