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
@param
docblock).Other bugfixes
try
statements 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
$flags
param 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_split
func_num_args
as pure (#4215)__invoke
declaration crash (#4210)if ((bool) $foo)
(#4206)Spl*
classes (#4255)allowMissingFiles
was fixed by @ddeboer (#4259)MissingConstructor
issues on a single class (#4297)positive-numeric
assertion (#4306)class-string|Foo
union (#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
phpstorm
report format that displays errors in a manner that PHPStorm can parse more easily (#4085) – thanks @the-toster (with additional help from @Rarst)Detection of
strpos
issuesPsalm 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 ofstrpos
can 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-override
which 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::__invoke
doesn't break when running Psalm in PHP 7.2.11 and below (#4111)UndefinedTrait
(#4130)preg_match_all
$matches
array value (#4128)Closure
type anywhere in the affected methods (#4148)Iterator::current
(#4146)numeric
always (#4154)count($arr) <= 1
(#4169)count
calls further (#4175)yield
expressions in function arguments (#4122)array_merge
andarray_filter
functionsv3.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-immutable
annotations (#4036):Running
vendor/bin/psalm --alter --issues=MissingPureAnnotation,MissingImmutableAnnotation
will 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 acallable
that 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_array
check (#4038)null
in assertions (#4061)positive-int
types (#4081, #4093)ParamNameMismatch
to be suppressed locally (#4012)@method
annotations(#4083)strpos
that precludes negative numbersMissingPropertyType
can now be refined on a per-property basis (#2200)strval
to allownull
v3.14.2
: Fix another regressionCompare Source
Bugfixes
@psalm-type
to reference imported type right above (#3999)hash_*
function signatures - thanks @baukevdw (#4014)float
defaults in namespaced class@method
docblock annotations (#4017)pgsql
functions - thanks @TysonAndre (#4021)foreach
docblock annotations - thanks @weirdan (#4029)pcntl_fork
is disabled - thanks @weirdan (#3951)@psalm-suppress
on 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 static
where the constructor is not declaredfinal
(#3934).For more information, see the issue page
Other features
--memory-limit
flag (#3947)Bugfixes
positive-int
types (#3914)scalar-class-constant
types in a few more places (#3913, #3741)hash_file()
(#3920)class-string
keys when appending literal classes (#3923)bscale
as 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-type
errors (#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 === true
where$some_bool
would have sufficed.This option is hidden behind the
strictBinaryOperands
config 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)substr
comparisons based on string length (#3877)@var
docblock annotations are now supported in many more places (#1916)Bugfixes
@template T as self
inside traits (#3753)array_map
should remember how an array was created (#3764)getReferenceAtPosition
(#3783)false
andnull
from a templated var (#3790)$i++
inside anisset
check (#3802)array_column
such that it can understand emptiness (#3813)*getcsv
return types more specific (#3832)strval
andsprintf
key
,array_key_first
andarray_key_last
(#3838)UndefinedClass
issue that could crop up with params of typearray|callable
(#3842)__unserialize
(#3845)falsy
assertions (#3858)class-string
type when doing an empty check (#3894)final
via trait aliasing (#3897)instanceof
(#3907)v3.12.2
Compare Source
Taint analysis bugfixes & features
print
,unserialize
,create_function
and more as sinksforeach
(#3670)@property
annotation (#3668)filter_var
(#3675)is_string
checks (#3680)exit
just asecho
is (#3681)preg_replace_callback
__toString
methods (#3697)@psalm-suppress TaintedInput
Other features
@olleharstedt added support for
@psalm-self-out
, which allows some typestate-oriented programming in Psalm (#3650)Bugfixes
get_class($foo) === static::class
Redis
(#3673)PDO::query
now allows two arguments (#3694)RdKafka\ProducerTopic::producev
(#3700)@internal
annotations on classes to their methods (#3698)Foo|?
return type (#3716)@method
(#3721)TemplateChecker
pluginclone
-ing undefined class (#3719)if
conditionals insidedo {...} while();
(#3685)false
to be removed from template params (#3737)v3.12.1
: Improve taint analysis a littleCompare Source
Taint analysis
$_REQUEST
is now treated as a source, and taints now flow throughtrim
and similar funcs@psalm-taint-specialize
now works in static methodsAlso @TysonAndre added a
--debug-emitted-issues
command line flag to help debug the route of a Psalm issue.Bugfixes
preg_replace_callback
now 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-assert
calls (#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.