chore(deps): update dependency vimeo/psalm to v7.22.1 #19
No reviewers
Labels
No labels
ansible
ci
dependencies
digest
docker
fix
go
javascript
major
minor
patch
php
python
released
security
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dawid/nextcloud-talk-stickers!19
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/all-minor-patch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
7.12.0→7.22.1Release Notes
vimeo/psalm
v7.22.1Compare Source
What's Changed
Fixes
Internal changes
TNamedObject::setValueIsStatic()ignoring$is_static_resolvedby @orklah in #15127Full Changelog: https://github.com/vimeo/psalm/compare/7.22.0...7.22.1
v7.22.0: Call-site varianceCompare Source
New AI, UX and
@templatesyntax features.Features
covariantorcontravariantbefore a type argument makes one param accept a generic of any subtype (or supertype) of it, without changing the class's template. As withBox<*>, values then go one way only: from aBox<covariant Node>you readNode, but can't put anything in. (#15096, @alies-dev)psalm --explain=<issue>prints an issue's documentation (what it means, an example, how to fix it) from the installed version, offline and without a config. It takes the issue type, its shortcode or its psalm.dev link. (#15066, @alies-dev, @roxblnfk)CLAUDECODE,CURSOR_AGENT,CODEX_THREAD_ID,AI_AGENT, …), it prints thecompactformat (one line per issue), no progress output even ifCIis set, a one-line result (also0 issues), and[*]after each issue--altercan fix. An explicit--output-formatwins, and nothing changes outside an agent. See AI agents. (#15068, #15069, #15067, @alies-dev)--no-taint-analysisskips taint analysis for one run (runTaintAnalysisis on by default), e.g. for a quick local check (#15078, @orklah).InternalFunctionfor a call of an@internalor@psalm-internalfunction from outside its namespace. (#15084, @orklah)ParseErrorfor constructor property promotion when analysing PHP 7.x. (#15086, @orklah)--alteron PHP 8.2 writestrue,falseandnullas native types (: true|nullinstead of: bool|nullplus a docblock), and no longer adds docblocks that repeat a native type. (#15083, @orklah)Performance
Fixes
Taint analysis
TaintedCallablefor a tainted method name:$object->$name(),A::$name(). (#15072, @alies-dev)strip_tags()with allowed tags is not an html escape:strip_tags($_GET["x"], "<a>")isTaintedHtml. (#14753, @arpitjain099)Stubs and plugins
@return(or its own@psalm-overload) replaces the original's@return $thisand overloads, so a stubbed call returns the stub's type again (a 7.19.0 regression). (#15090, @alies-dev)MethodSignatureMismatchfor an override that widens a param of a stubbed userland class, andfloat/intswaps PHP rejects are reported. (#15114, @orklah)[]onDs\Map,Ds\Vectorand other Ds collections is typed and checked, and a stub class that leaves out a method of its interfaces still has it. (#15039, @orklah)nullkeeps the function's params checked. (#15040, @orklah)[$this, 'method']:CallAnalyzer::getFunctionIdsFromCallableArg()takes the call'sContext. (#15082, @orklah)@mixinfor a method behind__call()/__callStatic(). (#15020, @shu-chen-dot-ca)Arrays and narrowing
isset()and!isset()on array offsets: a negated check drops the shapes that always have the offset and keeps the optional offsets it leaves; an empty array stays empty; a nestedisset($a["x"][3])narrows$a["x"]. (#15103, #15104, #15105, #15076, @orklah)switchcase is analysed knowing the cases before it didn't match. (#14528, @jirkace)mixedfallback keeps that key's type. (#14815, #14611, @jirkace)is_int(),is_bool()andis_string()keep the emptiness ofempty-scalarandnon-empty-scalar. (#14431, @jirkace)is_callable()on a list can be true. (#14319, @jirkace)MixedAssignment/MixedArgumentin aforeachover an always-empty list, such aslist<T>of anewcovariant generic. (#15095, @alies-dev)Types and templates
value-of<T>of a backed enum template is an array key, and$case->valueof aTis avalue-of<T>. (#14618, @jirkace)Card&object{last4: string}&object{brand: string}). (#14457, @jirkace)staticin the params of a@methodtag resolves to the called class. (#14480, @jirkace)void|neverisvoid, notnull:AssignmentToVoidis reported, and an always-exiting function is noInvalidReturnType. (#15087, @orklah)pow()with a zero and a float operand is a float. (#14845, @ARAYN7011)PHP_INT_MINis negative,PHP_DEBUG/PHP_ZTSare0|1(boolsince PHP 8.4), and$_SERVER["DOCUMENT_ROOT"],["SCRIPT_FILENAME"]and["PATH_TRANSLATED"]can be empty. (#15079, #15092, @orklah)get_object_vars()doesn't include static properties. (#15011, @jirkace)Functions, classes and properties
PropertyNotSetInConstructorfor a redeclared promoted property or one assigned through$this->$name. (#15038, @orklah)NonInvariantPropertyType. (#14623, @jirkace)$thisit writes, and a by-reference capture gets what the closure leaves in it. (#15048, #15052, @danog)ReferenceConstraintViolationfor a reference rebound before abreakor in aswitchcase. (#13710, @jirkace)MismatchingDocblockReturnType. (#13213, @jirkace)InvalidReturnTypeon PHP 8.1+. (#15081, @orklah)global $xin a function has the type declared in<globals>. (#15116, @orklah)Scanning and includes
requireof a ternary between two paths is resolved, and the files a dependency requires through one are scanned (Carbon 3'sCarbonPeriod). (#15094, @bardrop; #15080, @orklah)ssh2_*functions belong to ext-ssh2, not ext-swoole. (#15106, @orklah)CLI and config
src/C3.php changed while Psalm was running. Run Psalm again.instead of a crash, and a worker crash is printed once. (#15061, @alies-dev)-cwith a directory or an empty path reportsCannot read the config fileinstead of crashing. (#14947, @tlq5l)config.xsdacceptsallowMissingFileson<projectFiles>,<extraFiles>and<errorLevel>. (#15037, @orklah)Docs
allowMissingFilesand the*/**path patterns. (#15037, @orklah)SecurityIssuein<unsuppressibleIssues>keeps every security issue reported. (#15074, @danog)Internal changes
New Contributors
Full Changelog: https://github.com/vimeo/psalm/compare/7.21.1...7.22.0
v7.21.1Compare Source
Fixes
Taint analysis
foreachwrote back under their keys reaches a cast. (#14965, @orklah)f(...[safe(), $_GET['x']]),$firstis no longer tainted. (#14979, @shu-chen-dot-ca)array_walk()andarray_walk_recursive()callbacks write to their by-reference param flows into the array. (#14963, @danog)Templates and type variables
class-string<T>,key-of<T>,value-of<T>,T[K]andproperties-of<T>resolve whennewbinds the template:(new ReflectionClass(new stdClass()))->getName()isclass-string<stdClass>. An inheritedself<T&C>assertion narrows a subclass again. (#14981, @orklah)properties-of<T>over several classes includes the properties of each. (#14982, @orklah)class-string<T>|Tparam given a class string bindsTto the class only, without a falseIncompatibleTypeParameters. (#14994, @orklah)@template T of staticcalls a method returningTon$thisorstatic::. (#14978, @shu-chen-dot-ca)Narrowing, loops and arrays
$x != ""and$x != 0removenulland the loosely equal bool from$x. (#14995, @orklah)foreachover a non-empty list assigns before everybreakis defined after it. (#12439, @jarstelfox)extract()a variable assigned on one path is no longer read as possibly undefined. (#12442, @jarstelfox)PossiblyUndefinedVariableon$r?->m() ?? [], orTypeDoesNotContainNullon$r?->p ?? [], when$rmay be undefined. (#14998, @orklah)foreachkey,array_key_last()) keeps its shape. (#15009, @orklah)$a + [...]combined with a shape: no falsePossiblyUndefinedArrayOffseton keys both declare, and noInvalidArgumentwhen it is passed to a sealed shape param. (#15002, @orklah)DOMNamedNodeMap,Dom\NamedNodeMap,Dom\NodeListandDom\HTMLCollectionare read by position or name instead of reportingInvalidArrayAccess. (#14535, @jirkace)Properties and constructors
$object::$propis checked as a static fetch on the object's class, so undeclared and instance-only properties reportUndefinedPropertyFetch. (#12046, @HenkPoley)MissingConstructorfor a subclass inheriting the real constructor of a class a stub declares without one, and noPropertyNotSetInConstructorafterAncestor::__construct(). (#15001, @orklah)@psalm-suppress UndefinedConstantapplies to constants in docblock types (@var int-mask<NO_SUCH_CONSTANT>). (#13540, @alies-dev)Purity
DateTimeandDateTimeImmutableconstructors require only thetimecapability, and theDateIntervalconstructor is pure. (#14962, @jirkace)Stubs
CURLFOLLOW_ALL,ETH_P_ALL,PHP_BUILD_DATE, …) are declared. (#13019, @alies-dev)DateInterval::createFromDateString()no longer returnsfalseon PHP 8.3+. (#11849, @xelaris)SQLite3Result::columnName()can returnfalse. (#11819, @stof)ReflectionObjectis generic, likeReflectionClass. (#11774, @Kenny1911)Language server and
--alter--alterwrites only native types the analysed PHP version supports (noobjectbelow 7.2) and writesint|stringforarray-keyfrom PHP 8.0. (#14933, @orklah)Internal changes
New Contributors
Full Changelog: https://github.com/vimeo/psalm/compare/7.21.0...7.21.1
v7.21.0Compare Source
Features
HttpClientInterface::request()is an SSRF sink. (#14950, @danog)strtolower()andstrtoupper()of literal strings return literals:strtoupper(rand(0, 1) ? "get" : "Post")is'GET'|'POST'. (#14628, @jirkace)Performance
Generator::send()calls only through nodes a generator flows into: 17 s to 10 s for that step on a ~5,600-file codebase. (#13504, @jarstelfox)Fixes
Taint analysis
ENT_QUOTES,JSON_HEX_TAG) stay known when a library callsdefine()with a dynamic name, so the escaping they ask for is kept. (#14949, @danog)Assertions and narrowing
@psalm-assert-if-trueand@psalm-assert-if-falseof a remembered call apply when the call is compared withtrueorfalse. (#14605, @jirkace)($s .= "a") === "1a") narrows the variable it assigns. (#14532, @jirkace)TypeDoesNotContainType. (#14609, @jirkace)isset()on a sealed array with a template offset bounded by the array's keys is no longer anInvalidArrayOffset. (#14603, @jirkace)Types and templates
callable-objectno longer fits an object shape or acallable-objectof another signature. (#14929, @MikeFTV)newleft unbound is checked against constraints naming other templates of the class (IncompatibleTypeParameters). (#12443, @jarstelfox)Internal changes
Full Changelog: https://github.com/vimeo/psalm/compare/7.20.0...7.21.0
v7.20.0Compare Source
Features
@psalm-overload: gives a function or method several signatures, and a call returns the result of the first one its arguments fit. See@psalm-overload. Constructors are not supported yet. (#13353, #13354, @jirkace)@psalm-database-query ... readonlymarks a method that can only run reading queries, so its queries Psalm can't parse store nothing. See the annotation. (#14860, @danog){name}and{name:Type}query parameters are stored, clauses after the tables of aSELECTare parsed,INSERT ... FORMATstores its data in the listed columns, andALTER TABLE ... UPDATEstores likeUPDATE. (#14854, #14859, #14857, @danog)sprintf()with a literal format is parsed, and a query in a variable ($sql . " LIMIT 1") starts with what the analysis knows of$sql. (#14858, #14856, @danog)realpath()result checked to start with a directory is not a path traversal, and a path that starts with a directory is not an SSRF target. (#14171, @danog)Codebase::addTaintedCall()adds calls that PHP code doesn't make (a Twig template calling a filter) to the taint graph, andAddCallTaintsInterfaceandRemoveCallTaintsInterfacehandlers run for these calls, which have noExpr. (#13658, @danog)Fixes
Taint analysis
json_decode(),html_entity_decode()) give back the taints that the escapes before them removed. Escape flags with a variable operand, or flags a call may have changed, no longer count as escaping. (#13642, @danog)Types
non-falsy-stringpassed as acallable-stringreportsArgumentTypeCoercion. (#14925, @orklah)UnsafeGenericInstantiationfornew staticwhenstaticis only an array shape key in the return type. (#14920, @orklah)@psalm-assert iterable&CountablekeepsCountable, and intersections are compared by every part. (#14944, @orklah)$int & <non-negative int>is bounded by the non-negative operand:$i & 0x0Fisint<0, 15>. (#14507, @jirkace)callable-array. (#13424, @jirkace)T&Stringablecasts to string whenTis bounded byobjector unbounded, and the cast charges__toString()in pure code. (#14471, @jirkace)class-string-mapcombined into another array has its template replaced by its bound, andclass-string-map<T of Foo, T>keeps its bound in a namespace. (#14934, @orklah)list<int>, notarray). (#14923, @orklah)Templates
@implementsargument, without a falseMoreSpecificImplementedParamType. (#14459, @jirkace)non-empty-string, notarray|non-empty-string). (#14582, @jirkace)Narrowing, loops and arrays
$xafter$t = gettype($x)unlinks$t, soswitch ($t)no longer narrows the new$xtonever. (#14937, @orklah)$x === $ywith$yone of several class-strings keeps all of them. (#14938, @orklah)!array_is_list()of a value that is always a list reportsTypeDoesNotContainType. (#14529, @jirkace)isset($array[$id])with astring$idon an array with int keys is not anInvalidArrayOffset. (#14652, @jirkace)fororwhileloop whose counter starts beyond every value of an int bound (for ($i = 1; $i <= $size; $i++)with$size: int<1, max>) is always entered. (#14543, @jirkace)do/whilecondition on an offset of amixedvariable no longer holds after the loop. (#14584, @jirkace)??accepts any left side (null ?? 1, a constant, an operation) withoutInvalidArgument, and drops itsnull. (#14591, @jirkace)rememberPropertyAssignmentsAfterCall="false", refinements of readonly properties survive calls. (#14571, @jirkace)Classes, properties and constants
static::or an object of a non-final class, has that type instead ofmixed. (#14596, @jirkace)selfin the type of a trait property resolves against the class using it,staticin an inherited property type against the class read, andget_object_vars()resolves template-bound literals. (#14512, @jirkace)PropertyNotSetInConstructor. (#14566, @jirkace)if (!class_exists(...)), a function body) in a namespaced file are analysed. (#13654, @danog)autoloadalso loads is no longer treated as unshipped becauseautoload-devmaps it too. (#14936, @danog)--alterproperties-of<T>is written as a nativearray. (#14930, @lyn1dev)non-empty-string) gets a docblock, and enums and anonymous class parents get the right namespace. (#14917, @orklah)[]or inside an intersection is parenthesised. (#14921, #14935, @orklah)Internal changes
Atomic::getId()no longer falls back togetKey(), so a plugin type that extendsAtomicmust write its id or it throws aLogicException. (#14922, @orklah)New Contributors
Full Changelog: https://github.com/vimeo/psalm/compare/7.19.0...7.20.0
v7.19.0Compare Source
Features
@phpstan-sealedis read like@psalm-inheritors. (#11818, @stof)composer.jsonrequires any Symfony package, not onlysymfony/framework-bundle. (#14682, @danog)ensureOverrideAttributealso reportsMissingOverrideAttributefor a property (PHP 8.5), class constant or enum case (PHP 8.6) that overrides a parent member. (#14407, @jirkace)UndefinedPropertyFetchorUndefinedPropertyAssignmenton a property declared by@propertyin a class without__get()/__set()says to add the magic method or setusePhpDocPropertiesWithoutMagicCall="true". (#14644, @jirkace)@psalm-traceworks on static properties (self::$name). (#14629, @jirkace)Fixes
Narrowing and conditions
==keeps the values PHP juggles:"1" == 1,1 == 1.0,false == [],$stringable == "a". (#14906, @orklah)== 0keeps thefalseandnullloosely equal to it, so($h = fopen(...)) == 0is no longer aParadoxicalCondition. (#14823, @orklah)isset()on an offset of a possibly-nullmixednarrows in anelseifas in anif. (#14393, @orklah)match (false)narrows the variables of its conditions. (#14354, @jirkace)$item?->flag !== true,$itemis not null. (#14460, @jirkace)instanceofkeeps what is known of its properties. (#14537, @jirkace)!array_key_exists($key, $array)on a generic array says nothing about$key. (#14613, @jirkace)stringorintcan be identical tokey-of<T>orvalue-of<T>of a templateT of array. (#14437, @jirkace)instanceof UnitEnumorBackedEnumexcludes classes that aren't enums. (#14526, @jirkace)($a['k'] ?? false) && ...establishes that the key is set. (#14377, @jirkace)isset()and??on a magic property are not decided by the type of__get()(SimpleXMLElementchildren). (#14363, @jirkace)ParadoxicalConditionon a clause about a variable that a nested loop writes. (#14899, @orklah)ifwhose condition on an array offset always holds no longer makes the key optional. (#14896, @orklah)isset()in anifkeeps the same type as without it. (#14893, @orklah)RedundantConditionorTypeDoesNotContainType. (#14822, @orklah)empty()of a possibly undefined bool is not anInvalidArgument. (#14819, @orklah)MixedArrayAccessis reported when a!empty($p['a'])check is stored in a variable first. (#14824, @orklah)switch (true)overinstanceofchecks of final classes is not anInvalidReturnType. (#13362, @jirkace)Loops
whileorforloop whose condition holds on entry is always entered. (#14419, @jirkace)&&in aforcondition is defined in the body and the step. (#14827, @orklah)switchon a call doesn't stay in scope after it. (#14569, @jirkace)Arrays
$array + ['key' => $default]has the keys of the shape, and so does a shape plus an array. (#14621, @jirkace)$a[$k][$i] = $v) is non-empty. (#14404, @jirkace)$a[$k]++,$a[$k] += 1and by-reference arguments. (#14540, @jirkace)ArrayAccessobject no longer checks a wrong value againstoffsetSet(). (#14371, @jirkace)Templates and generics
foreach, array fetches and destructuring from a generic construction resolve their type variables. (#14897, @orklah)non-empty-listcondition. (#14830, @orklah)falserecords a bound on a type variable likenulldoes. (#14589, @jirkace)mixed. (#14592, @jirkace)newon a generic class keeps the template open when inherited public members can constrain it. (#14448, @jirkace)@propertyuses the template arguments of the parent. (#14530, @jirkace)$thiswith@psalm-this-outreturns the@psalm-this-outtype. (#14639, @jirkace)class-string<T>with@template T as array|objectis not anInvalidDocblock. (#11755, @vincent4vx)array<mixed>passed to aniterable<string>param is aMixedArgumentTypeCoercion, and conditional types such as($iterable is list ? never : list<T>)work again. (#13329, @andrew-demb)callable(never)hint no longer turns a typed closure param intonever. (#14447, @jirkace)I&staticin a final class implementingIis that class. (#14461, @jirkace)Classes, methods and constants
matchwhose every branch is$thisis$this, and so istap($this, $callback). (#14818, #14895, @orklah)PossiblyNullReferenceafter a call with arguments in a nested nullsafe chain. (#14850, @alies-dev)AmbiguousConstantInheritancefor a constant reached through a parent class and an interface. (#12663, @Aerendir)OverriddenPropertyAccesswhen a subclass redeclares a protected property of a native extension class. (#12052, @jturbide)PossiblyInvalidArgumentinstead ofInvalidArgumentwhen a member of the argument's union is a parent type of the param. (#14820, @orklah)int-mask-of<self::A_*>wildcard ignores constants that aren't integers. (#14348, @jirkace)Purity
DateTimeImmutable,PDO,Redis, …) is no longer treated as pure. (#14816, @orklah)strtr()replacements,array_multisort()with string flags and unpackedimplode()arguments charge__toString(). (#14451, @jirkace)curl_share_setopt(),imap_timeout()andimap_expunge()are impure. (#11858, @ThomasLandauer)Taint analysis
vprintf()format andcurl_setopt()options are read by param, also from named and unpacked arguments. (#14454, @jirkace)extract()of a sealed array is noTaintedExtract, and the variables it assigns carry the array's taint. (#14601, @jirkace)Stubs
urlencode()andrawurlencode()of anon-empty-stringare non-empty. (#14521, @jirkace)get_class()combined with other strings is anon-falsy-string. (#14355, @jirkace)Ds\Hashable::equals()takes$obj. (#14373, @jirkace)MissingExtensionRequirementis reported for them. (#14686, @danog)Messages
RedundantCast,InvalidArrayOffset,InvalidIterator, and any message that includes a union). (#14903, #14905, @orklah)MixedMethodCallnames the known type ofobjectand object shapes. (#14347, @jirkace)CLI, config and tools
--threads=). (#14336, @jirkace)psalm-refactorrejects destinations PHP reserves as class or constant names. (#14617, @jirkace)--alterkeeps string refinements (non-empty-string,non-falsy-string) in the docblocks it writes. (#14913, @orklah)Plugin API
FunctionParamsProviderInterfacehandler returning[]declares no params; returnnullto leave them unchanged. (#11622, @kkmuffme)Union::getKey()is deprecated and will be removed in Psalm 8: usegetId()to identify a type. (#14910, @orklah)Internal changes
StreamSelectDriverworker fork to 6.x. (#14839, @orklah; #14750, @zonuexe)New Contributors
Full Changelog: https://github.com/vimeo/psalm/compare/7.18.0...7.19.0
v7.18.0: Contravariant templatesCompare Source
Features
@template-contravariant(also@psalm-and@phpstan-template-contravariant): a template for a class that only takes values, such as a handler, writer or mapper. ASink<Animal>fits where aSink<Dog>is expected, not the other way round, and Psalm reports the template where the class gives a value out. Plugins read the variance withClassLikeStorage::getTemplateVariance(). See Template contravariance; the templated annotations page was rewritten with checked examples. (#14669, @alies-dev)--debug-performance(short name--profile) prints where a run spent its time and memory: stages, workers, the slowest files, statements and functions, and plugin handlers. With a path it also writes a JSON profile that you can drop on https://psalm.dev/profile/ to see it as charts; the page reads it in your browser and sends it nowhere. See Finding out why Psalm is slow. (#14737, #14769, #14807, @alies-dev)skills/psalmteaches AI coding agents to run Psalm, fix its issues, write annotations and editpsalm.xmlthe way the docs recommend. Install it withnpx skills add vimeo/psalm --skill psalm, with thellm/skillsComposer plugin, or by copyingvendor/vimeo/psalm/skills/psalminto your agent's skills directory. (#13152, @roxblnfk; #14751, @danog; #14795, @roxblnfk)Performance
Fixes
Templates and type variables
new Pipe(fn (int $x) => ...)with aClosure(T): voidconstructor param capsTatint, so a later$pipe->push('s')isIncompatibleTypeParametersinstead of reaching theintcallback. (#14669, @alies-dev)@template U of T) is reported in a param even after an earlier param usedUlegally. (#14669, @alies-dev)new Coll([1]), then$c->add('x')) see every value it holds, not only the construction-site ones. (#14551, @shu-chen-dot-ca)nullno longer fits a template without a bound:fn() => nullforcallable(): T,[null]forlist<T>. (#14550, @shu-chen-dot-ca)@use. (#13429, @jirkace)@implements Wrapper<static>resolvesstaticto the object it is read from, and chained calls on such a value no longer hang. (#14572, @jirkace)@return static<NewK, NewV>on a template receiver keeps its new type arguments. (#14579, @jirkace)ImplementedReturnTypeMismatch. (#14502, @jirkace)preg_replace()on an array ofStringablereturns an array). (#14421, @jirkace)Tread at akey-of<T>offset isvalue-of<T>. (#14586, @jirkace)is_int(),is_scalar()and similar checks narrow a template bounded byscalar,numeric,array-keyor an int range instead of reportingDocblockTypeContradiction. (#14545, @jirkace)class-string<T>. (#14365, @jirkace)Coll<*>) gives the template's bound instead ofmixed. (#14666, @alies-dev)@template, the variance and the declared order of templates instead of marking every template@template-covariant. (#14669, @alies-dev)Narrowing and arrays
$a !== $bwith several possible values of$bdoesn't exclude them all from$a. (#14525, @jirkace)isset($array[$k])with$kone of several literal keys,$array[$k]is the value of those keys. (#14646, @jirkace)$arr[$key]stays known to be set when$keyis narrowed insideif (isset($arr[$key])). (#13344, @jirkace)InvalidArrayOffsetis reported when an item is read again under an index narrowed to a key the array can't have. (#14767, @orklah)($a ?? null) !== nullassertsisset($a). (#14517, @jirkace)instanceofa parent class narrows to the parent class. (#14318, @jirkace)get_class()of a union of classes is the name of any of them. (#14366, @jirkace)V&object{x: string}) has the type of both. (#14546, @jirkace)ensureArray*OffsetsExist, an offset that may be one of several literals is set only when each of them is. (#14606, @jirkace)maxShapedArraySize. (#14641, @jirkace)"a\r\nb"). (#14600, @jirkace)'6e5212ed-…'in Symfony'sFormconstraint. (#14797, @leonardsimonse)pow()of two int literals is an int literal. (#14505, @MikeFTV)Control flow
continueorbreakis possibly undefined after the loop. (#14509, @jirkace)breakthat reassigned it. (#14456, @jirkace)&&are defined in the next operands of the enclosing&&. (#14409, @jirkace)throworexitin a branch returnsvoid, notnever. (#14793, @MikeFTV)return, so it is noUnusedFunctionCall. (#14562, @jirkace)Callables and nullsafe calls
?->in a chain are analysed with a non-null receiver, as PHP skips the whole chain when it is null. (#14608, @jirkace)?->apply where the call is truthy. (#14531, @jirkace)__invoke()is callable. (#14590, @jirkace)__call()is not anUndefinedMagicMethod. (#14411, @jirkace)staticin closure hints of calls in a trait on other objects resolves to that object. (#14446, @jirkace)Closureobject of unknown signature is aClosure. (#14599, @jirkace)yield fromforwards the send type of the inner generator. (#14340, @jirkace)Reported issues
nullorfalsewith the expected type isInvalidArgument, notPossiblyInvalidArgument, in closure params ofarray_map()and similar functions and in__set()calls on a@property. (#14742, @orklah)ParadoxicalConditionon a dead||operand next to other values of the same variable. (#14821, @orklah)ParamNameMismatchfor a name another overridden method uses. (#14536, @jirkace)MethodSignatureMismatchfor@no-named-argumentson parameterless methods. (#14799, @orklah)sethook is checked against the hook's param type. (#14538, @jirkace)array_column()reads are used. (#14560, @jirkace)@implementsnaming an interface the class doesn't implement gets the same message with or without type arguments. (#14650, @jirkace)@psalm-suppressbefore the expression ofechoor<?=is read. (#14527, @jirkace)Stubs
ini_get()of a core setting no longer includesfalse. (#14809, @alies-dev)intval(),floatval()anddoubleval()report what the casts report. (#14311, #14805, @jirkace)ArrayObject::offsetSet()andArrayIterator::offsetSet()accept anulloffset. (#14516, @jirkace)pgsqlextension stub with thePGSQL_*constants, and the classes of thegeosextension. (#14637, #14631, @jirkace)FILTER_THROW_ON_FAILUREis defined and has no failure value. (#14359, @jirkace)Redis::auth()andRedisCluster::__construct()accept phpredis ACL credentials. (#14800, @orklah)WeakMap,SoapClient,MemcachedandPDOStatementuse the PHP 8 param names. (#14353, #14367, @jirkace)Name::$partsand uses v5'sArrayItemfor array and list items. (#14514, @jirkace)CLI, config and tools
reportInfo="false"also dropsPossibly*issues that takeinfofrom their parent issue. (#14785, @alies-dev)console,phpstormandgithub, run statistics (--stats, the timing line, the--profilesummary) go to stderr. (#14745, @alies-dev)--update-baselinekeeps multi-line samples of CRLF files. (#14794, @ARAYN7011)MissingDependencyand four other issues. (#14649, @jirkace)--generate-stubskeeps the trait uses and the interfaces of a class with a parent. (#14564, @jirkace)@psalm-scope-thisis scanned. (#14565, @jirkace)psalm-refactorrejects reserved words as destinations. (#14552, @MohannadElemary)Internal changes
PluginTestworks with psalm/plugin-phpunit 1.3.3. (#14810, @orklah)FunctionLikeAnalyzer::getFunctionLikeNode()(#14635) andConfig::getPreloadedStubFiles()(#14633), @jirkace. Psalm now requires psalm/psalm-plugin-api 0.5.2. (#14846, @alies-dev)New Contributors
Full Changelog: https://github.com/vimeo/psalm/compare/7.17.0...7.18.0
v7.17.0Compare Source
What's Changed
Features
Fixes
Internal changes
Full Changelog: https://github.com/vimeo/psalm/compare/7.16.0...7.17.0
v7.16.0: Star projectionCompare Source
Features
Foo<*>: Kotlin's syntax for a generic argument you don't know. Reads go through the template's bound (Box<*>::get()isobjectforT of object), writes through it expectnever, andBox<*>accepts anyBox. See Star projection. (#13139, #13493, #14619, #14598, @alies-dev)Performance
||chains ofstr_starts_with(). Important for WordPress projects (#14653, @alies-dev)**entry already matched: 60 to 85 % faster with**/vendor-style entries. (#14624, @alies-dev)@methodtags: scanning up to 5 % faster on classes with hundreds of them, such as AWS SDK clients and Laravel Facades. (#14620, @alies-dev)Fixes
Templates
@extends Base<list<U>>,@extends Base<Box<TModel>>, also across two@extendslevels). (#14487 @jirkace, #14558 @alies-dev)newon a@template-covariantclass infersneverfor a template nothing can constrain, sonew Coll()fitsColl<int>. (#14449, @jirkace)Callables and invokable objects
__invokeis callable. (#14610, @alies-dev)array_map()with an invokable object as the callback infers the return type of__invokeinstead oflist<mixed>. (#14654, @alies-dev)Closureis expected is anArgumentTypeCoercion, not anInvalidArgument. (#14657, @alies-dev)Other
--find-references-tofinds the calls of a function. (#14648, @jirkace)Docs
Internal changes
Full Changelog: https://github.com/vimeo/psalm/compare/7.15.0...7.16.0
v7.15.0Compare Source
What's Changed
Features
Fixes
Internal changes
Full Changelog: https://github.com/vimeo/psalm/compare/7.14.0...7.15.0
v7.14.0Compare Source
What's Changed
Features
Fixes
Docs
Internal changes
New Contributors
Full Changelog: https://github.com/vimeo/psalm/compare/7.13.2...7.14.0
v7.13.2Compare Source
What's Changed
Fixes
Full Changelog: https://github.com/vimeo/psalm/compare/7.13.1...7.13.2
v7.13.1Compare Source
What's Changed
Fixes
Full Changelog: https://github.com/vimeo/psalm/compare/7.13.0...7.13.1
v7.13.0Compare Source
What's Changed
Features
Fixes
Docs
Internal changes
Full Changelog: https://github.com/vimeo/psalm/compare/7.12.0...7.13.0
Configuration
📅 Schedule: (in timezone Europe/Berlin)
* 0-5 * * 1)🚦 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 CLI.
1818f9f8db2f7175e506chore(deps): update dependency vimeo/psalm to v7.22.0to chore(deps): update dependency vimeo/psalm to v7.22.1Tests of CI / php (dev-master): passed
21 passed, 0 failed, 5 skipped (26 tests, 0.1 s)
Of
d0c09c304c, the run, updated by every run.Tests of CI / php (dev-stable32): passed
21 passed, 0 failed, 5 skipped (26 tests, 0.0 s)
Of
d0c09c304c, the run, updated by every run.Tests of CI / php (dev-stable33): passed
21 passed, 0 failed, 5 skipped (26 tests, 0.1 s)
Of
d0c09c304c, the run, updated by every run.Tests of CI / php (dev-stable34): passed
21 passed, 0 failed, 5 skipped (26 tests, 0.1 s)
Of
d0c09c304c, the run, updated by every run.Tests of CI / php (dev-stable35): passed
21 passed, 0 failed, 5 skipped (26 tests, 0.1 s)
Of
d0c09c304c, the run, updated by every run.