chore(deps): update dependency vimeo/psalm to v3.18.2 #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.11.6->3.18.2⚠ Dependency Lookup Warnings ⚠
Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.
Release Notes
vimeo/psalm
v3.18.2: Improve treatment of finally blocksCompare Source
Last night's release added a regression in how variables set in try statements are treated, ticketed here: https://github.com/vimeo/psalm/issues/4368
v3.18.0: BugfixesCompare Source
Language server works again
This fixes an issue that prevented the language server from seeing recent changes to files (caused, almost inexplicably, by removing a
@paramdocblock).Other bugfixes
trystatements without catches (#4333, #4366)||if conditionals (#4354)v3.17.2: Fix two regressionsCompare Source
v3.17.1: Fix preg_splitCompare Source
3.17.0 added a potentially-erroneous return type when a non-zero
$flagsparam is passed topreg_split. This fixes things.v3.17.0: A bunch of bugfixesCompare Source
Features
ParadoxicalCondition(example) – thanks to @dkarlovi, @jbafford and @ro0NL for their inputBugfixes
Fixed XML generation
3.16 broke XML output, this is now fixed (#4252).
Other bugfixes
random_int, providing better inference (#4199)preg_match_all(#4202) and @orklah helped improvepreg_splitfunc_num_argsas pure (#4215)__invokedeclaration crash (#4210)if ((bool) $foo)(#4206)Spl*classes (#4255)allowMissingFileswas fixed by @ddeboer (#4259)MissingConstructorissues on a single class (#4297)positive-numericassertion (#4306)class-string|Foounion (#4310)Also thanks to @orklah for many linting PRs, and to @weirdan for very good triaging
v3.16: A smattering of thingsCompare Source
Features
New PHPStorm-optimised output format
Added a
phpstormreport format that displays errors in a manner that PHPStorm can parse more easily (#4085) – thanks @the-toster (with additional help from @Rarst)Detection of
strposissuesPsalm will now raise two separate issues for the following code:
The first,
InvalidLiteralArgument, complains a string was passed where a variable was expected. The second complains that the output ofstrposcan never be negative.Allow intersection of object-like arrays and regular arrays
Psalm now allows the docblock
array{foo: string}&array<string, string>, understanding it to mean an array of strings with one explicit known key.@psalm-stub-override
Added support for
@psalm-stub-overridewhich only renders the stub valid if the given class already exists – thanks @weirdan (#4177)@psalm-suppress Issue1, Issue2
Added support for multiple suppressed issues on a given line – thanks @weirdan (#4179)
Bugfixes
Allow multiple issues of the same type at a single position
Psalm will now report multiple issues that map to the same code position (but whose message body is different). If you use the baseline, you might need to update it accordingly (#4167)
Other bugfixes
Closure::__invokedoesn't break when running Psalm in PHP 7.2.11 and below (#4111)UndefinedTrait(#4130)preg_match_all$matchesarray value (#4128)Closuretype anywhere in the affected methods (#4148)Iterator::current(#4146)numericalways (#4154)count($arr) <= 1(#4169)countcalls further (#4175)yieldexpressions in function arguments (#4122)array_mergeandarray_filterfunctionsv3.15: Automatically add pure/immutable annotationsCompare Source
Features
This release brings a couple of features that are useful to fans of functional programming.
If you're unfamiliar with these concepts, or want to know how Psalm uses them, read this article first.
Automatic addition of
@psalm-pure/@psalm-immutableannotations (#4036):Running
vendor/bin/psalm --alter --issues=MissingPureAnnotation,MissingImmutableAnnotationwill add those annotations to any function, method or class that deserves it.So
is transformed into
Note: running this command will not recursively add annotations, so if you have a chain of callers like
running the command once will produce
and running it a second time will produce
Pure callables and closures
Thanks to @azjezz, Psalm now understands the annotation
pure-callable, which allows you to guarantee the purity of a pure function that executes a callable.Let's say we want to return the longest string in an array of strings
["a", "bbb", "cc"]. We could write that function pretty simply, but let's suppose we want to make it a bit more generic: given an array of items, and acallablethat returns a score for the each entry, return the highest-scoring value.We can define that function in PHP like
This function is only pure, though, if the callable that we're passing is pure.
With this latest version the full, pure type signature of the function can be written:
Bugfixes
is_arraycheck (#4038)nullin assertions (#4061)positive-inttypes (#4081, #4093)ParamNameMismatchto be suppressed locally (#4012)@methodannotations(#4083)strposthat precludes negative numbersMissingPropertyTypecan now be refined on a per-property basis (#2200)strvalto allownullv3.14.2: Fix another regressionCompare Source
Bugfixes
@psalm-typeto reference imported type right above (#3999)hash_*function signatures - thanks @baukevdw (#4014)floatdefaults in namespaced class@methoddocblock annotations (#4017)pgsqlfunctions - thanks @TysonAndre (#4021)foreachdocblock annotations - thanks @weirdan (#4029)pcntl_forkis disabled - thanks @weirdan (#3951)@psalm-suppresson every run – thanks @micheh (#3011)v3.14.1: Fix regressionCompare Source
Fixes a crash with this code:
v3.14.0: Flag named argument discrepanciesCompare Source
Features
Named argument checks with ParamNameMismatch
For more information, see this article.
Preventing unsafe instantiation
Psalm now warns you when calling
new $foo()where$foo()is a class that can be extended and where the constructor is not declaredfinal, ornew staticwhere the constructor is not declaredfinal(#3934).For more information, see the issue page
Other features
--memory-limitflag (#3947)Bugfixes
positive-inttypes (#3914)scalar-class-constanttypes in a few more places (#3913, #3741)hash_file()(#3920)class-stringkeys when appending literal classes (#3923)bscaleas impure (ref #3918)list-ness when assigning to a tuple inside a loop (#3928)array_shift(#3941)callStatic(#3939)reset's return typeusort(#3964)@psalm-import-typeerrors (#3997)v3.13.1: Minor bugfixesCompare Source
fgetcsv(now more lenient)v3.13.0: Allow MissingPropertyType to be fixed automaticallyCompare Source
Features
MissingPropertyType fixer
Running
vendor/bin/psalm --alter --issues=MissingPropertyType(when using PHP 7.4) ongives
This fix has full compatibility with previous versions of PHP, too.
=== true detection
@greg0ire added support such that Psalm will warn you when comparing
$some_bool === truewhere$some_boolwould have sufficed.This option is hidden behind the
strictBinaryOperandsconfig flag.positive-int
Psalm has a new type,
positive-int, for situations where you want the typechecker to guarantee that an integer is positive.Other features
@internal, hopefully clarifying its usage (#3841)substrcomparisons based on string length (#3877)@vardocblock annotations are now supported in many more places (#1916)Bugfixes
@template T as selfinside traits (#3753)array_mapshould remember how an array was created (#3764)getReferenceAtPosition(#3783)falseandnullfrom a templated var (#3790)$i++inside anissetcheck (#3802)array_columnsuch that it can understand emptiness (#3813)*getcsvreturn types more specific (#3832)strvalandsprintfkey,array_key_firstandarray_key_last(#3838)UndefinedClassissue that could crop up with params of typearray|callable(#3842)__unserialize(#3845)falsyassertions (#3858)class-stringtype when doing an empty check (#3894)finalvia trait aliasing (#3897)instanceof(#3907)v3.12.2Compare Source
Taint analysis bugfixes & features
print,unserialize,create_functionand more as sinksforeach(#3670)@propertyannotation (#3668)filter_var(#3675)is_stringchecks (#3680)exitjust asechois (#3681)preg_replace_callback__toStringmethods (#3697)@psalm-suppress TaintedInputOther features
@olleharstedt added support for
@psalm-self-out, which allows some typestate-oriented programming in Psalm (#3650)Bugfixes
get_class($foo) === static::classRedis(#3673)PDO::querynow allows two arguments (#3694)RdKafka\ProducerTopic::producev(#3700)@internalannotations on classes to their methods (#3698)Foo|?return type (#3716)@method(#3721)TemplateCheckerpluginclone-ing undefined class (#3719)ifconditionals insidedo {...} while();(#3685)falseto be removed from template params (#3737)v3.12.1: Improve taint analysis a littleCompare Source
Taint analysis
$_REQUESTis now treated as a source, and taints now flow throughtrimand similar funcs@psalm-taint-specializenow works in static methodsAlso @TysonAndre added a
--debug-emitted-issuescommand line flag to help debug the route of a Psalm issue.Bugfixes
preg_replace_callbacknow supports arrays properly even when the closure is not well-documented (#3639)v3.12.0: Add --taint-analysis commandCompare Source
This will be the officially-supported taint analysis command going forward.
v3.11.7: Add more taint analysis featuresCompare Source
Features
<extraFiles>tag to tell Psalm about directories it should scan, but not analyse (#3618)Bugfixes
switch (true)case statements (#3603)@psalm-assertcalls (#3605)(Foo\Bar::class)::baz()asFoo\Bar::baz()(#3609)'\Foo\Bar::baz'to be treated as callables (#3607)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.