Releases: vimeo/psalm
Releases · vimeo/psalm
5.13.1
What's Changed
Fixes
- Fix glob CallMap and stub to prevent crash on alpine by @ygottschalk in #9942
Docs
Full Changelog: 5.13.0...5.13.1
5.13.0
What's Changed
Features
- Add a support for multilevel glob wildcards by @2e3s in #9813
- Mapping closed inheritance to union during assertion by @klimick in #9829
- Use PHPStorm output format by default on JetBrains terminals by @lptn in #9848
- sprintf basic non-empty-string return type provider by @kkmuffme in #9841
- Extend Shepherd payload by information about package versions by @lptn in #9856
- Allow if/false assert for same variable to allow array/list distinction by @kkmuffme in #9853
- readonly does not have write access, therefore is safe as long as the… by @kkmuffme in #9887
- Sprintf improve return param type validation by @kkmuffme in #9877
- feat: cache.gz by @dkarlovi in #9889
- make compressor configurable v2 by @kkmuffme in #9924
- Invalidate cached methods when referenced files are deleted by @tscni in #9931
- Invalidate cached methods when referenced class property types change by @tscni in #9955
Fixes
- glob: allow empty string for pattern by @Hanmac in #9814
- GH-9825 by @jack-worman in #9828
- Fix #9824 const enum self reference by @ygottschalk in #9833
- base64_decode returns false only in strict mode by @kamil-tekiela in #9832
- Dirname return type non empty string by @kkmuffme in #9837
- uniqid return type non-empty-string inconsistent by @kkmuffme in #9842
- PropertyNotSetInConstructor should not report for abstract constructors by @kkmuffme in #9844
- Intersect template types during inheritance check by @klimick in #9865
- Fix generic type params mapping by @klimick in #9866
- Better intersection of template types during inheritance check by @klimick in #9883
- Update the signature of debug_backtrace by @stof in #9868
- Glob return type stub by @ygottschalk in #9878
- Improve the return types for getimagesize and getimagesizefromstring by @robchett in #9875
- Unmark DateInterval::$invert as read-only by @morozov in #9895
- Sprintf additional validations and bugfix by @kkmuffme in #9904
- Fixes #9827 by @ygottschalk in #9903
- set type of LINE to positive int by @robchett in #9921
- Add a stub file for Attributes defined by PHP by @robchett in #9920
- Don't update types of the outer scope when in an elseif conditional by @robchett in #9922
- Update callmap for ext-mongodb 1.16 by @alcaeus in #9933
- Add call map entries for MongoDB functions by @alcaeus in #9934
- fix reconciliation between a list and iterable by @orklah in #9950
non-empty-list
assertion for iterable by @boesing in #9953- fix PHP 7 sprintf too many arguments false positive by @kkmuffme in #9943
Docs
Internal changes
- Introduce and use
IssueData
constants for severity levels by @lptn in #9846 - Shepherd: send a list of issues (instead of array with int keys) by @lptn in #9845
- fix failing mock tests by @kkmuffme in #9880
- Bump mheap/github-action-required-labels from 4 to 5 by @dependabot in #9898
- fix CI warnings for findUnusedCode in psalm 6 by @kkmuffme in #9915
- docblock parser minor performance gain by @kkmuffme in #9916
- improve perfs for switch by not creating reverse assertions against constants by @orklah in #9929
- remove StementsVolatileCache for perf reasons by @orklah in #9930
- put config to true to prevent deprecations for new config files by @orklah in #9857
- Make config warn about missing cache related functions by @ygottschalk in #9935
- Fix/cache fail silent by @ygottschalk in #9932
Typos
New Contributors
Full Changelog: 5.12.0...5.13.0
5.12.0
What's Changed
Features
- WIP - Limit inheritance to a subset of classes #1450 by @robchett in #9687
- UnsupportedPropertyReferenceUsage by @jack-worman in #9769
- Improve return types of pow() by @robchett in #9795
- Narrow the type of $haystack when strpos(...) !== false by @robchett in #9788
- allow using more than 8G of memory in psalter by @orklah in #9805
Fixes
- Fix missing global class type when scanning cached files by @tscni in #9735
- Fix union argument type check against templated param by @klimick in #9750
- Allow dynamic properties from PHPDoc by @fluffycondor in #9742
- improve glob stubs by @kkmuffme in #9752
- Removed return type false from date and gmdate by @Alkisum in #9761
- methods and vars cannot be falsy by @kkmuffme in #9796
- fix offset for type param changes by @orklah in #9803
Docs
- Documented suggestions for HTML user input by @mmcev106 in #9780
- Document array shape unsealing syntax by @robchett in #9784
Internal changes
New Contributors
Full Changelog: 5.11.0...5.12.0
5.11.0
What's Changed
Fixes
- SplDoublyLinkedList's index is always int by @kamil-tekiela in #9736
- Fix string negation to never by @klimick in #9743
- Fix ParadoxicalCondition with complex match expression by @klimick in #9739
- Fix invalid cast for templated class-string by @klimick in #9738
- Fix OverriddenPropertyAccess error message by @edsrzf in #9740
- Ignore nullable return form SimpleXMLElement::addChild() by @greg0ire in #9745
Full Changelog: 5.10.0...5.11.0
5.10.0
What's Changed
Features
- Introduce
value-of
with backed enum cases in assertions by @boesing in #9586 - Introduce callable object intersection by @boesing in #9599
- Contextual inference for const callable by @klimick in #9623
- Allow to intersect type alias with non-type-aliases by @boesing in #9638
- Provide support for templated
value-of
enum values by @boesing in #9655 - (re-)implement object-shape assertions by @boesing in #9656
- Support anonymous object template replacement by @klimick in #9664
- Implement unsealed array generic syntax by @danog in #9694
- Introduce BeforeExpressionAnalysisEvent by @tuqqu in #9725
- Add support for @psalm-no-seal-properties and @psalm-no-seal-methods by @robchett in #9681
Fixes
- Fix remaining intl, reflection. xml and zip callmaps by @othercorey in #9595
- fix #9049 by @orklah in #9598
- fix coercion detection between two keyed arrays by @orklah in #9606
- fix: treat includes starting with '.' and '..' correct by @jjjb03 in #9608
- Allow enabling mixed issues reporting for error levels > 2. by @ADmad in #9626
- Preserve
non-empty-string
type when combining literal and numeric strings by @boesing in #9630 - Do not report required closure arguments as unused by @boesing in #9629
- Fix various db callmaps by @othercorey in #9632
- fix: add missing constructor parameter to IteratorIterator by @SenseException in #9646
- Flatten
match
arm conditions to check conditions independently by @tuqqu in #9647 - Fixed non empty arg issue in array_splice function by @whizsid in #9643
- Fix
array_flip
to preserve non-empty array type by @tuqqu in #9651 - Fix list template replacement by @klimick in #9658
- Fix iterable template replacement by @klimick in #9660
- Fix/9373 using enum property as const array key by @ygottschalk in #9393
- Specify array share for
stream_context_get_params
return value by @lptn in #9663 - Fixed crash issue when using multiple literals for array_splice by @whizsid in #9673
- Fix comparison of unions of multiple callables by @danog in #9676
- Add stub for DateInterval by @robchett in #9682
- Return a non-empty-(lowercase-)string from mb_strtolower by @robchett in #9678
- Don't throw UnnecesseryVarAnnotation when hinting a mixed template var by @robchett in #9679
- Fix is_object assertions on final classes by @danog in #9686
- Add return type provider for date/gmdate by @robchett in #9691
- Avoid wrong assertions when working with objects returned by methods by @danog in #9685
- Handle included directory paths without crashing by @edsrzf in #9701
- Contextual closure arg inference for class methods by @klimick in #9700
- Fix #9692 by @danog in #9693
- Allow running new on template objects by @danog in #9704
- Fix date return type provider by @danog in #9711
- Fix UnevaluatedCode false positive at declare(strict_types=1) by @klimick in #9719
- Fix ambiguous constant inheritance false positive by @Jean85 in #9720
Docs
- Add CLI help for the error-level option by @dantleech in #9590
- Replace
@template T as X
with@template T of X
in documentation by @janopae in #9690 - Make it easier to find how to promote Trace by @greg0ire in #9717
- Document @mixin by @robchett in #9706
Internal changes
- Bump mheap/github-action-required-labels from 3 to 4 by @dependabot in #9601
- Avoid verbose opcache logging by @danog in #9670
- Valid array access on a non-empty-string yields a non-empty-string by @robchett in #9675
- Remove clone leftovers from immutable refactoring by @danog in #9709
New Contributors
- @dantleech made their first contribution in #9590
- @jjjb03 made their first contribution in #9608
- @SenseException made their first contribution in #9646
- @tuqqu made their first contribution in #9647
- @whizsid made their first contribution in #9643
- @janopae made their first contribution in #9690
Full Changelog: 5.9.0...5.10.0
5.9.0
What's Changed
Features
json_encode()
returns a non-empty-string withJSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE
by @fluffycondor in #9479- WIP: Performance/Feature Improvements to the Language Server by @tm1000 in #8960
- Support int separators in docblocks by @weirdan in #9491
- @Property annotations: allow not implying @psalm-seal-properties by @danielbeardsley in #9568
- Improve PHP8 str_* function signatures by @fluffycondor in #9534
- Contextual inference for first-class-callable by @klimick in #9570
Fixes
- Compare list generic params by @weirdan in #9487
- Add
truthy-string
to reserved word list. by @ZebulanStanphill in #9486 - Fix #9433 by @ptomulik in #9439
- Add missing array, float, int and bool types to callmaps by @othercorey in #9474
- Fix asserted property mangling by @weirdan in #9507
- Fix return type of str_split() by @othercorey in #9504
- Fix integer overflow in array keys by @weirdan in #9499
- Set inside_call for eval expressions by @edsrzf in #9519
- Improve json_encode/json_decode functions signatures by @fluffycondor in #9525
- Fix MissingThrowsDocblock when documented interface is extended by thrown exception interface by @paoloconi96 in #9528
- Fixed #9496 by @ptomulik in #9497
- Prevent assertion leaks from
else
by @weirdan in #9538 - Fixed coercion of mixed into non-empty-mixed by @weirdan in #9541
- always combine the result of expansions by @orklah in #9562
- Clean up unreflectable callmap methods by @othercorey in #9526
- Add better return type to mysqli fetch_field* by @MoonE in #9555
- [mysql] Add stubs for
mysqli
,mysqli_result
andmysqli_stmt
classes by @phansys in #9547 - Fix array_unique callmap by @othercorey in #9323
- Improve types for range() by @kamil-tekiela in #9577
- Fixed #9506 by @ptomulik in #9509
- Handle different line endings from baseline. by @DnwK98 in #9566
Docs
- Doc/psalm api on methods by @ygottschalk in #9544
Internal changes
- Optimize composer caching by @weirdan in #9493
- Update phar-build to large resource class in config.yml by @weirdan in #9494
- Refuse to use PHP versions we did not request by @weirdan in #9492
- Make Atomic subclasses consistently call their parent constructors by @edsrzf in #9406
- Remove always-empty ClassAnalyzer leftover_stmts array by @edsrzf in #9522
- Skip gnupg extension in callmap tests by @othercorey in #9576
New Contributors
- @ZebulanStanphill made their first contribution in #9486
- @paoloconi96 made their first contribution in #9528
- @MoonE made their first contribution in #9555
- @danielbeardsley made their first contribution in #9568
- @DnwK98 made their first contribution in #9566
Full Changelog: 5.8.0...5.9.0
5.8.0
What's Changed
Features
- FFI stubs improvement by @UlrichEckhardt in #9368
- Support sizeof alias of count by @jsanahuja in #9375
- Iterated array in
foreach
body is never empty by @weirdan in #9380 - Process
@psalm-api
tags on methods by @weirdan in #9383 - Enforce literal string length limit by @weirdan in #9381
- [ibm_db2] Improve return type inference for
db2_autocommit()
by @phansys in #9310 - Only disable grpc extension if it is not properly configured by @gndk in #9398
- PHP 8.3 dictionary by @lptn in #9366
- concat should never remove non empty non falsy from string #9411 by @EgorBakulin in #9422
- Forbid private final methods by @weirdan in #9442
- Support for
readonly
classes by @weirdan in #9444 - Consider new HTML entity en/decode function defaults since PHP 8.1 by @pereorga in #9471
Fixes
- Instances of
object
returned bydb2_*()
functions are always instances ofstdClass
by @phansys in #9369 - Simplify and fix Shepherd to support custom endpoints for reporting by @lptn in #9296
- Fixes #9384 (Wrong type for variable checked with is_long) by @ygottschalk in #9385
- Update Phar callmaps by @othercorey in #9389
- Correctly process use aliases in
@psalm-scope-this
by @weirdan in #9390 - Allow
array
as magic method name by @weirdan in #9391 - Consistently report docblock issues on all classlikes by @weirdan in #9392
- [ibm_db2] Update some return types in callmaps by @phansys in #9387
- Preserve PossiblyUndefinedVariable when fixing UnusedVariable by @edsrzf in #9400
- [ibm_db2] Update callmaps by @phansys in #9404
- Fix #9401 by @ptomulik in #9418
- Fix remaining spl and iterator callmaps by @othercorey in #9420
- An attempt to fix #4460 by @ptomulik in #9415
array_pop
is impure by @weirdan in #9434- Revert "
array_pop
is impure" by @weirdan in #9435 - Update pack() stub by @othercorey in #9438
- Merge param descriptions when adding or updating types by @aboyton in #9441
- PHP 8.2 attributes moved to 8.2 stub by @weirdan in #9445
- Improce enum case reconciliation by @weirdan in #9457
- Do not strip the last
)
bracket when parsing phpdoc type aliases. by @pvandommelen in #9458 - Replace package-versions with Composer 2 APIs by @Jean85 in #9459
- Fix DOM callmaps by @othercorey in #9460
- Don't crash on unary minus overflow by @weirdan in #9466
- Fix remaining intl callmaps by @othercorey in #9473
Internal changes
- Convert callmap associative-array types into proper array types by @othercorey in #9362
- Callmap is always non-empty by @weirdan in #9405
- Reorganize pushes to
psalm/phar
by @weirdan in #9399 - Do not display ext deprecation note when
disableExtensions
used by @lptn in #9291 - Require
<?php
tag in tests by @weirdan in #9443
New Contributors
- @UlrichEckhardt made their first contribution in #9368
- @jsanahuja made their first contribution in #9375
- @EgorBakulin made their first contribution in #9422
- @pereorga made their first contribution in #9471
Full Changelog: 5.7.7...5.8.0