Releases: vimeo/psalm
Releases · vimeo/psalm
4.30.0
What's Changed
Features
- Enhance type detection for internal php functions
key
,current
,end
andreset
by @boesing in #8584 - Add dictionary delta for PHP 8.2 by @lptn in #8634
- Add support for phpstan assertions by @VincentLanglet in #8654
Fixes
- Add additional checks for concat of non-empty strings to return non-falsy by @gphargreaves in #8585
- Correct return type of DateTimeImmutable sub method stub by @gphargreaves in #8583
- fix wrong php version id in $_FILES by @kkmuffme in #8600
- #7810/improve reflection stubs by @gphargreaves in #8592
- ensure callbacks have the required number of params by @kkmuffme in #8594
- Fix for issue #8631 by @hamburnyog in #8639
- Fix XMLReader::expand() nullable parameter $baseNode by @BenMorel in #8641
- Do not report serialize as unused by @VincentLanglet in #8650
- serialize is not pure for array of object by @VincentLanglet in #8652
- Fix Spl file handling signatures by @neclimdul in #8644
- Remove
argc
andargv
elements from$_ENV
by @weirdan in #8666 - adding openssl_x509_verify by @orklah in #8677
Internal changes
- Allow to set PHP 8.2 version by @franmomu in #8643
- Fix assert testing callmap return types by @othercorey in #8676
New Contributors
- @neclimdul made their first contribution in #8644
Full Changelog: 4.29.0...4.30.0
4.29.0
What's Changed
Fixes
- Update dictionaries for hash ext functions by @lptn in #8553
- More specific superglobals feedback update by @kkmuffme in #8561
- Update Phpredis stubs to return false on failure by @kkmuffme in #8555
- Fix MinMaxReturnTypeProvider when handling TDependentListKeys by @nosnickid in #8567
New Contributors
- @nosnickid made their first contribution in #8567
Full Changelog: 4.28.0...4.29.0
4.28.0
What's Changed
Features
- Make ctype_digit and ctype_lower work as assertions by @fluffycondor in #8450
- report invalidCasing when using a class that is not user defined too by @kkmuffme in #8465
- Update call maps for MongoDB extension by @alcaeus in #8432
- Add dateTimeModify return type provider by @VincentLanglet in #8462
- make superglobals more specific by @kkmuffme in #8473
- Fix invalid casts int and float by @kkmuffme in #8366
- add hideAllErrorsExceptPassedFiles config option by @kkmuffme in #8502
- Add int type aliases based on existing codes by @hamburnyog in #8530
- Add check for class const with reserved word 'class' by @gphargreaves in #8542
Fixes
- Fix ctype_digit assertion bug by @fluffycondor in #8466
- partial revert nullable type for curl_multi_getcontent by @kkmuffme in #8367
- classlike_alias incorrect casing not handled correctly by @kkmuffme in #8468
- Update phpredis.phpstub by @sergkash7 in #8136
date_get_last_errors()
,DateTime::getLastErrors()
may return false by @gsteel in #8478- Fix array_key_exists first argument false positive by @hirokinoue in #8489
- Fix array_column with object and column name null by @HypeMC in #8491
- Add null-type to several DOM-functions by @tvdijen in #8490
- Make Psalter add
@throws
annotation with properly namespaced exception by @d-claassen in #8480 - use cache for declared function when available before falling back to stubs by @kkmuffme in #8503
- fix crash in <PHP8 with ResourceBundle by @kkmuffme in #8416
- Fixed function signatures of imap_delete and imap_undelete by @ppdeblieck in #8537
Docs
- Document the object with properties syntax by @HypeMC in #8493
- Make template constraints examples in docs consistent by @HypeMC in #8492
Internal changes
- GitHub Workflows security hardening by @sashashura in #8451
- preg_replace with anchor will always only have 1 replacement by @kkmuffme in #8469
- Consistent error logging for cache by @kkmuffme in #8415
New Contributors
- @sashashura made their first contribution in #8451
- @alcaeus made their first contribution in #8432
- @sergkash7 made their first contribution in #8136
- @gsteel made their first contribution in #8478
- @HypeMC made their first contribution in #8493
- @d-claassen made their first contribution in #8480
- @hamburnyog made their first contribution in #8530
- @ppdeblieck made their first contribution in #8537
- @gphargreaves made their first contribution in #8542
Full Changelog: 4.27.0...4.28.0
4.27.0
What's Changed
Features
- added truthy-string alias for non-falsy-string by @staabm in #8400
- added SensitiveParameter, AllowDynamicProperties php 8.2 attributes by @staabm in #8427
- Allow *bin2hex and *bin2base64 functions to keep non-empty-string type by @LeSuisse in #8431
- Allow any attribute for complex types in schema by @den-kuz in #8428
- trim(), ltrim(), rtrim() now keep lowercase string attribute by @SCIF in #8444
Fixes
- Added better stubs for
DateTimeImmutable
, highlighting how the constructor is NOT immutable by @Ocramius in #8350 - Use classlike_storage_provider only if it has the required data by @Daeroni in #8376
- Fix
imageinterlace
function signature by @paulfedorow in #8403 - Clarification of
Reflection::getModifierNames()
result type by @vjik in #8405 - Ensure we recognize inherited static methods for the first-class callables by @someniatko in #8370
- Add support for callable in array_reduce by @VincentLanglet in #8435
- Configure a correct attribute target in stubs/CoreGenericClasses.phpstub by @TimWolla in #8436
Internal changes
Typos
- add ", but" for InvalidArgument error message where a type is provided by @kkmuffme in #8364
- Fix doc typos by @krsriq in #8424
New Contributors
Full Changelog: 4.26.0...4.27.0
4.26.0
What's Changed
This release fix an regression introduced in the last version. Upgrade is recommended
Fixes
- #8330 - take into account that
static
type may have been unwrapped inhasStaticInType()
by @someniatko in #8335 - recognize
@psalm-allow-private-mutation
in PHP 8+ constructors by @someniatko in #8341 - ReflectionProperty::getValue $object is nullable since php 8.0 by @mathroc in #8344
- Fix formatCurrency return type by @VincentLanglet in #8349
Full Changelog: 4.25.0...4.26.0
4.25.0
What's Changed
Features
- New "Count" Report Format by @jack-worman in #8244
- Adds support for fixing missing throws doc block by @aszenz in #7994
Fixes
- Stop using deprecated string interpolation syntax in StatementsProvider.php by @TimWolla in #8188
- Fix return type of ReflectionNamedType::getName() by @BenMorel in #8201
- Fix several CallMap function signatures by @othercorey in #8217
- fix: ltrim may return class-string #8218 by @Tofandel in #8219
- use lock to fix race condition in cache by @kkmuffme in #8240
- Fix GEOSGeometry stubs with default values by @BenMorel in #8214
- Fix nullable return types for CallMap functions by @othercorey in #8228
- Improve inferring the "final"
static
type when calling static methods inside a different class by @someniatko in #8249 - fix triggerErrorExits not working by @kkmuffme in #8304
- Fixed ini_set types for arg value by @honca in #8308
- Add stub for DatePeriod by @fluffycondor in #8312
Internal changes
- Various minor improvements to speed up by ~10% by @kkmuffme in #8193
- chore: Set permissions for GitHub actions by @naveensrinivasan in #8189
- chore: Included githubactions in the dependabot config by @naveensrinivasan in #8203
- build(deps): bump mheap/github-action-required-labels from 1 to 2 by @dependabot in #8207
- build(deps): bump fkirc/skip-duplicate-actions from 3.4.0 to 4.0.0 by @dependabot in #8208
- build(deps): bump actions/cache from 2 to 3 by @dependabot in #8209
- build(deps): bump actions/checkout from 2 to 3 by @dependabot in #8210
- Allow testing expected CallMap return types by @othercorey in #8166
- Fix codestyle errors in InternalCallMapHandlerTest by @othercorey in #8220
- use error_log instead of trigger_error by @kkmuffme in #8243
- fix race conditions causing notices if directory does not exist by @kkmuffme in #8302
New Contributors
- @TimWolla made their first contribution in #8188
- @naveensrinivasan made their first contribution in #8189
- @dependabot made their first contribution in #8207
- @Tofandel made their first contribution in #8219
- @aszenz made their first contribution in #7994
- @someniatko made their first contribution in #8249
- @honca made their first contribution in #8308
Full Changelog: 4.24.0...v4.25.0
4.24.0
What's Changed
Features
- Infer object shape when array or scalar is cast to object by @theodorejb in #7935
- Improve @return annotation for implode() so that it can handle non-empty-array of non-empty-strings case by @hirokinoue in #7967
- Bugfix/#7912 class APCuIterator does not exist by @KevinVanSonsbeek in #7982
- Improve @psalm-internal and prevent usage of IssueBuffer::add(). by @AndrolGenhald in #8165
- Encapsed literal strings by @AndrolGenhald in #8164
Fixes
- fix missing is_a() parameter type by @staabm in #7951
- Improve array_unique callmap stubs by @mathroc in #7981
- Precise stat return type by @VincentLanglet in #8032
- Bugfix/splfileobject fputcsv invalidnamedargument by @KevinVanSonsbeek in #8042
- Fix
TypeCombiner::combine
to not modify TIntRange arguments. by @AndrolGenhald in #8049 - Coerce null to empty string in array keys by @weirdan in #8064
- Fix generic object comparison to use template constraint as default. by @AndrolGenhald in #8069
- Fix possibly empty array shape appearing non-empty (fixes #8048). by @AndrolGenhald in #8051
- fix #8099: ob_implicit_flush argument type changed to bool by @SamMousa in #8100
- number_format: allow third and forth parameters to be nullable by @drealecs in #8114
- Add ReflectionClass & ReflectionObject::isEnum() by @BenMorel in #8117
- Add missing ldap_unbind mapping for php 8.1 by @othercorey in #8126
- Fix signatures of ldap_* functions by @othercorey in #8147
- Fix datefmt_* function signatures by @othercorey in #8153
- Fix filter_var and filter_var_array signatures by @othercorey in #8152
- Fix array_* function signatures by @othercorey in #8151
- Add ReflectionProperty properties by @BenMorel in #8148
- Fix crash when redefining method with fewer params (fixes #8141). by @AndrolGenhald in #8174
Docs
- fix small error in plugins_type_system.md by @mathroc in #7914
- Clarify in docs that zero is not considered a positive-int by @bdsl in #8060
Internal changes
- Fix conflict of option -c with shell completion by @GromNaN in #7988
- change cache hash type for better performance by @kkmuffme in #7997
- micro-optimize condition by @kkmuffme in #8009
- igbinary_serialize code was missing in file by @kkmuffme in #8007
- Performance only load files once by @kkmuffme in #8011
- Fix syntax check failures by @weirdan in #8028
- Backport #7506 by @weirdan in #8027
- Run Shepherd with 8.0 by @weirdan in #8029
- Performance: cut the selected_text from snippet by @kkmuffme in #8055
- store origin location by ID to speed up psalm by up to 75% by @kkmuffme in #8054
- tests: add test that validates the callmap in the current runtime by @SamMousa in #8104
- Callmap validation ignore list cleanup by @SamMousa in #8144
Other changes
New Contributors
Full Changelog: 4.23.0...4.24.0
4.23.0
What's Changed
Features
- Add configuration for maximum size of shaped array by @danog in #7433
- Disable filepath formatting as a link for Drone CI's output by @white43 in #7861
- cache statements even without persistent parser cache by @vognev in #7876
- Fix sort assert annotation by @hirokinoue in #7908
Fixes
- Register openssl_sign function to impure functions by @samsonasik in #7746
- update phpredis stubs by @kkmuffme in #7752
- DateInterval::createFromDateString can be false by @Ne-Lexa in #7758
- Allow null to ArrayAccess::offsetSet $offset param by @franmomu in #7759
- Fix #7750: array_column type inference by @mtk3d in #7760
- Improve int range parsing by @fluffycondor in #7775
- Fix #3036: make argument $read of internal PHP function stream_socket nullable. by @niconoe- in #7718
- PDOStatement::fetchAll() has incorrect type by @hc-jworman in #7785
- More attribute fixes. by @AndrolGenhald in #7788
- Avoid json_encode when serializing non-UTF8 literals by @ohader in #7791
- Add return shape for Throwable::getTrace by @ciaranmcnulty in #7798
- Fix ftp_fget/_fput/_nb_fget/_nb_fput stream arg type by @mrardon in #7824
- Fix namespaced min/max int range keyword issue introduced in #7775 by @AndrolGenhald in #7829
- Psalm considers most readline functions as pure, but they have side effects by @mstilkerich in #7828
- Avoiding double spaces (v2) by @ThomasLandauer in #7837
- Fix Incompatible types found for T (Stub&ProxyQueryInterface is not in ProxyQueryInterface&Stub) by @VincentLanglet in #7838
- Further improve Throwable::getTrace() return type by @hirokinoue in #7864
- Fix openssl_csr_export() signature by @mpesari in #7866
- don't emit issues when doing arithmetics on float templates by @hirokinoue in #7872
- Fix return type of
ldap_search
by @paulfedorow in #7894 - Alter order of baseline option loading to permit updating custom baseline by @M1ke in #7904
- improve LSP by @ging-dev in #7887
Docs
Internal changes
New Contributors
- @Ne-Lexa made their first contribution in #7758
- @mtk3d made their first contribution in #7760
- @hc-jworman made their first contribution in #7785
- @gndk made their first contribution in #7801
- @mrardon made their first contribution in #7824
- @hirokinoue made their first contribution in #7864
- @white43 made their first contribution in #7861
- @vognev made their first contribution in #7876
- @paulfedorow made their first contribution in #7894
- @ging-dev made their first contribution in #7887
Full Changelog: 4.22.0...4.23.0
5.0.0-beta1
What's Changed
Removed
- Finalize (and internalize) more classes by @weirdan in #7578
- Finalize issues by @weirdan in #7595
- Finalize storages by @weirdan in #7597
- Finalize virtual nodes by @weirdan in #7598
- Finalize types nodes by @weirdan in #7623
- remove totallyTyped by @orklah in #7651
Deprecations
Features
- Resolve DIR / FILE when const/variable is used for include by @tomasz-kusy in #7585
- add ReflectionIntersectionType stub by @orklah in #7621
- Allow config to define thread count (4.x) by @M1ke in #7633
- add phpredis stubs by @kkmuffme in #7614
- Add configuration option to disable @var parsing everywhere except for properties. by @danog in #7434
- More class const improvements. by @AndrolGenhald in #7666
- Add
@psalm-check-type
and@psalm-check-type-exact
. by @AndrolGenhald in #7686 - feat(types): add properties-of type by @Patrick-Remy in #7359
- Invert meaning of dupe_key by @danog in #7475
Fixes
- fix wrong detection of purity by @orklah in #7545
- Fix object constant inference by @klimick in #7542
- Handle first class callable on unknown functions by @orklah in #7546
- Revert "PHP 8.1: Report missing typehints in overridden native methods" by @weirdan in #7539
- Ensure
trait_exists()
always returnsbool
by @Ocramius in #7554 - sealed keyed arrays by @orklah in #7558
- AtomicStaticCallAnalyzer: clear tmp var from context by @vincent4vx in #7561
- improving error message for Could not resolve config path by @phptest2 in #7573
- Fix crash when assigning reference to unknown array offset by @AndrolGenhald in #7583
- Strip colours from success message by @weirdan in #7620
- Fix #6683 by improving simplification of CNF by @muglug in #7631
- Honour global function suppressions for UndefinedFunction by @weirdan in #7657
- Update return type for mysqli::connect_error by @morozov in #7660
- Correct name of ErrorException::__construct $line param by @chloekek in #7659
- Enum collapsing by @orklah in #7655
- Enum assertions by @orklah in #7662
- Consistency for empty reconciliations by @orklah in #7663
- Fix false positive for unused variable in try (fixes #7613). by @AndrolGenhald in #7664
- fix count with match on arrays by @orklah in #7665
- Prevent unnecessary filter_var() warnings on primitive types by @mmcev106 in #7677
- Throw exception if file_put_contents failed by @dmitryuk in #7690
- Improve bool to int casting. by @AndrolGenhald in #7696
- Fix issues with int range unpacking and with min/max by @AndrolGenhald in #7699
- Analyze attribute statements instead of constructing virtual statements. by @AndrolGenhald in #7692
- Fix some minor issues with references. by @AndrolGenhald in #7684
- Config threads: add to config.xsd by @M1ke in #7708
- Use current context when analyzing attributes by @AndrolGenhald in #7713
- Fix first-class callable in loop by @trowski in #7715
- Support for properties in interfaces extending
\UnitEnum
&\BackedEnum
by @whatUwant in #7719 - PDOException extends RuntimeException and can use int code errors by @VincentLanglet in #7673
- allow SimpleTypeInferer to infer non empty lists by @orklah in #7732
- Attribute analysis improvements by @AndrolGenhald in #7727
- restore callable-string Id by @orklah in #7787
- fix refining lowercase string and non-empty-string together by @orklah in #7844
- Remove
@psalm-generator-return
annotation by @jrmajor in #7853 - Resolve #7855 remove false from return type, in php8.0 and further ve… by @dkemper in #7859
Docs
- doc about property initialization by @orklah in #7593
- Fix issue documentation links. by @AndrolGenhald in #7687
- Improve documentation for InvalidGlobal to explain that it's sometimes valid by @AndrolGenhald in #7693
- Fix int-mask-of doc example by @Seldaek in #7812
- Documented the allowMissingFiles attribute for ignoreFiles by @mmcev106 in #7867
Internal changes
- Fix extension capitalization issue, add extensions to version message. by @AndrolGenhald in #7574
- Added backward compatibility check by @weirdan in #7576
- Allow mocking final classes by @weirdan in #7591
- Fixed composer branch-alias by @sasezaki in #7594
- No longer require declare reflection-docblock:^5 as dependency by @sasezaki in #7612
- Bump up phpunit,prophecy, and introduced phpspec/prophecy-phpunit by @sasezaki in #7617
- consistency in AssertionFinder by @orklah in #7622
- skip a test because we removed the feature for now by @orklah in #7642
- Adjust for composer-require-checker check. by @sasezaki in #7632
- Removed .scrutinizer.yml by @sasezaki in #7652
- Use
array_fill_keys()
by @weirdan in #7661 - Fixed PSR-4 warnings by @weirdan in #7683
- chore: enable psl tests again by @azjezz in #7596
- Make callbacks marked as static by @SCIF in #6695
New Contributors
- @phptest2 made their first contribution in #7573
- @tomasz-kusy made their first contribution in #7585
- @chloekek made their first contribution in #7659
- @dmitryuk made their first contribution in #7690
- @whatUwant made their first contribution in #7719
- @Seldaek made their first contribution in #7812
- @dkemper made their first contribution in #7859
Full Changelog: 5.0.0-alpha1...5.0.0-beta1
4.22.0
What's Changed
Fixes
- Analyze attribute statements instead of constructing virtual statements. by @AndrolGenhald in #7692
- Config threads: add to config.xsd by @M1ke in #7708
- Use current context when analyzing attributes by @AndrolGenhald in #7713
- Fix first-class callable in loop by @trowski in #7715
- Support for properties in interfaces extending
\UnitEnum
&\BackedEnum
by @whatUwant in #7719 - PDOException extends RuntimeException and can use int code errors by @VincentLanglet in #7673
- allow SimpleTypeInferer to infer non empty lists by @orklah in #7732
- Attribute analysis improvements by @AndrolGenhald in #7727
New Contributors
- @whatUwant made their first contribution in #7719
Full Changelog: 4.21.0...4.22.0