chore(deps): update dependency vimeo/psalm to v7.22.1 #19

Merged
dawid merged 2 commits from renovate/all-minor-patch into main 2026-12-02 21:13:00 +00:00
Collaborator

This PR contains the following updates:

Package Change Age Confidence
vimeo/psalm 7.12.0 → 7.22.1 age confidence

Release Notes

vimeo/psalm

v7.22.1

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.22.0...7.22.1

v7.22.0: Call-site variance

Compare Source

New AI, UX and @template syntax features.

Features

  • Call-site variance: covariant or contravariant before a type argument makes one param accept a generic of any subtype (or supertype) of it, without changing the class's template. As with Box<*>, values then go one way only: from a Box<covariant Node> you read Node, but can't put anything in. (#​15096, @​alies-dev)
    /** @param Handler<covariant Node> $handler */
    function register(Handler $handler): void {}
    
    register(new LeafHandler()); // a Handler<LeafNode>: no issue (was InvalidArgument)
    
  • 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)
    vendor/bin/psalm --explain=PossiblyNullArgument
    vendor/bin/psalm --explain=078
    vendor/bin/psalm --explain=https://psalm.dev/078
    
  • AI coding agents: when Psalm runs under an agent (CLAUDECODE, CURSOR_AGENT, CODEX_THREAD_ID, AI_AGENT, …), it prints the compact format (one line per issue), no progress output even if CI is set, a one-line result (also 0 issues), and [*] after each issue --alter can fix. An explicit --output-format wins, and nothing changes outside an agent. See AI agents. (#​15068, #​15069, #​15067, @​alies-dev)
  • Crash reports name the plugin and hook that threw and the statement Psalm was analysing, save the full report to a file, and print a link that opens a prefilled issue on Psalm's or the plugin's tracker. (#​15070, @​alies-dev)
  • --no-taint-analysis skips taint analysis for one run (runTaintAnalysis is on by default), e.g. for a quick local check (#​15078, @​orklah).
  • New issues:
    • InternalFunction for a call of an @internal or @psalm-internal function from outside its namespace. (#​15084, @​orklah)
    • ParseError for constructor property promotion when analysing PHP 7.x. (#​15086, @​orklah)
  • --alter on PHP 8.2 writes true, false and null as native types (: true|null instead of : bool|null plus a docblock), and no longer adds docblocks that repeat a native type. (#​15083, @​orklah)

Performance

  • Narrowing a variable no longer copies the whole scope for every other variable, which made 7.18 about 2% slower than 7.17. (#​15121, @​alies-dev)

Fixes

Taint analysis
Stubs and plugins
  • A stub's @return (or its own @psalm-overload) replaces the original's @return $this and overloads, so a stubbed call returns the stub's type again (a 7.19.0 regression). (#​15090, @​alies-dev)
  • No false MethodSignatureMismatch for an override that widens a param of a stubbed userland class, and float/int swaps PHP rejects are reported. (#​15114, @​orklah)
  • [] on Ds\Map, Ds\Vector and other Ds collections is typed and checked, and a stub class that leaves out a method of its interfaces still has it. (#​15039, @​orklah)
  • A function params provider returning null keeps the function's params checked. (#​15040, @​orklah)
  • Params providers can resolve [$this, 'method']: CallAnalyzer::getFunctionIdsFromCallableArg() takes the call's Context. (#​15082, @​orklah)
  • A return type provider of a class wins over its @mixin for 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 nested isset($a["x"][3]) narrows $a["x"]. (#​15103, #​15104, #​15105, #​15076, @​orklah)
  • A switch case is analysed knowing the cases before it didn't match. (#​14528, @​jirkace)
  • Assigning an offset to a possibly-null array keeps the other offsets optional, and a nested write under a listed key of a shape with a mixed fallback keeps that key's type. (#​14815, #​14611, @​jirkace)
  • is_int(), is_bool() and is_string() keep the emptiness of empty-scalar and non-empty-scalar. (#​14431, @​jirkace)
  • is_callable() on a list can be true. (#​14319, @​jirkace)
  • No MixedAssignment/MixedArgument in a foreach over an always-empty list, such as list<T> of a new covariant generic. (#​15095, @​alies-dev)
Types and templates
  • The false branch of a conditional type bounds the template by the rest of its bound. (#​14647, @​jirkace)
  • value-of<T> of a backed enum template is an array key, and $case->value of a T is a value-of<T>. (#​14618, @​jirkace)
  • An intersection merges its object shapes (Card&object{last4: string}&object{brand: string}). (#​14457, @​jirkace)
  • An argument may fit any declaration of a method that several members of an intersection declare. (#​14977, @​shu-chen-dot-ca)
  • static in the params of a @method tag resolves to the called class. (#​14480, @​jirkace)
  • void|never is void, not null: AssignmentToVoid is reported, and an always-exiting function is no InvalidReturnType. (#​15087, @​orklah)
  • pow() with a zero and a float operand is a float. (#​14845, @​ARAYN7011)
  • PHP_INT_MIN is negative, PHP_DEBUG/PHP_ZTS are 0|1 (bool since 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
  • No false PropertyNotSetInConstructor for a redeclared promoted property or one assigned through $this->$name. (#​15038, @​orklah)
  • Overriding a property of a builtin class with its native type is no NonInvariantPropertyType. (#​14623, @​jirkace)
  • Calling a closure forgets the properties of $this it writes, and a by-reference capture gets what the closure leaves in it. (#​15048, #​15052, @​danog)
  • No false ReferenceConstraintViolation for a reference rebound before a break or in a switch case. (#​13710, @​jirkace)
  • The body is still analysed after MismatchingDocblockReturnType. (#​13213, @​jirkace)
  • An always-exiting function with a native return type is InvalidReturnType on PHP 8.1+. (#​15081, @​orklah)
  • global $x in a function has the type declared in <globals>. (#​15116, @​orklah)
Scanning and includes
  • require of a ternary between two paths is resolved, and the files a dependency requires through one are scanned (Carbon 3's CarbonPeriod). (#​15094, @​bardrop; #​15080, @​orklah)
  • With several scan threads, an autoloaded class is no longer replaced by a project file that redeclares it (IDE helpers). (#​15077, @​orklah)
  • ssh2_* functions belong to ext-ssh2, not ext-swoole. (#​15106, @​orklah)
CLI and config
  • A file that changes during a run stops it with 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)
  • -c with a directory or an empty path reports Cannot read the config file instead of crashing. (#​14947, @​tlq5l)
  • config.xsd accepts allowMissingFiles on <projectFiles>, <extraFiles> and <errorLevel>. (#​15037, @​orklah)

Docs

Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.21.1...7.22.0

v7.21.1

Compare Source

Fixes

Taint analysis
  • No crash ("Undefined array key -1") when an array whose values a foreach wrote back under their keys reaches a cast. (#​14965, @​orklah)
  • An unpacked element taints only the parameter it fills: in f(...[safe(), $_GET['x']]), $first is no longer tainted. (#​14979, @​shu-chen-dot-ca)
  • What array_walk() and array_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] and properties-of<T> resolve when new binds the template: (new ReflectionClass(new stdClass()))->getName() is class-string<stdClass>. An inherited self<T&C> assertion narrows a subclass again. (#​14981, @​orklah)
  • No infinite recursion when an object is added to its own template, and properties-of<T> over several classes includes the properties of each. (#​14982, @​orklah)
  • A class-string<T>|T param given a class string binds T to the class only, without a false IncompatibleTypeParameters. (#​14994, @​orklah)
  • No hang when a class with @template T of static calls a method returning T on $this or static::. (#​14978, @​shu-chen-dot-ca)
Narrowing, loops and arrays
  • $x != "" and $x != 0 remove null and the loosely equal bool from $x. (#​14995, @​orklah)
  • A variable that a nested foreach over a non-empty list assigns before every break is defined after it. (#​12439, @​jarstelfox)
  • A variable read where it is undefined is no longer possibly undefined on the loop's next iteration, and with extract() a variable assigned on one path is no longer read as possibly undefined. (#​12442, @​jarstelfox)
  • No false PossiblyUndefinedVariable on $r?->m() ?? [], or TypeDoesNotContainNull on $r?->p ?? [], when $r may be undefined. (#​14998, @​orklah)
  • A list written under keys it already has (its own foreach key, array_key_last()) keeps its shape. (#​15009, @​orklah)
  • $a + [...] combined with a shape: no false PossiblyUndefinedArrayOffset on keys both declare, and no InvalidArgument when it is passed to a sealed shape param. (#​15002, @​orklah)
  • Offsets of DOMNamedNodeMap, Dom\NamedNodeMap, Dom\NodeList and Dom\HTMLCollection are read by position or name instead of reporting InvalidArrayAccess. (#​14535, @​jirkace)
Properties and constructors
  • $object::$prop is checked as a static fetch on the object's class, so undeclared and instance-only properties report UndefinedPropertyFetch. (#​12046, @​HenkPoley)
  • No false MissingConstructor for a subclass inheriting the real constructor of a class a stub declares without one, and no PropertyNotSetInConstructor after Ancestor::__construct(). (#​15001, @​orklah)
  • @psalm-suppress UndefinedConstant applies to constants in docblock types (@var int-mask<NO_SUCH_CONSTANT>). (#​13540, @​alies-dev)
Purity
  • The DateTime and DateTimeImmutable constructors require only the time capability, and the DateInterval constructor is pure. (#​14962, @​jirkace)
Stubs
Language server and --alter
  • The language server keeps the types and references of a file without class methods when it analyses another file, so hover and go-to-definition keep working there. (#​15003, @​danog)
  • --alter writes only native types the analysed PHP version supports (no object below 7.2) and writes int|string for array-key from 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.0

Compare Source

Features

  • Symfony HttpClient taints: the body, headers, info and streamed chunks of its responses are input sources, and the URL of HttpClientInterface::request() is an SSRF sink. (#​14950, @​danog)
  • strtolower() and strtoupper() of literal strings return literals: strtoupper(rand(0, 1) ? "get" : "Post") is 'GET'|'POST'. (#​14628, @​jirkace)

Performance

  • Taint resolution links 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)
  • Taint resolution builds a flow's trace only for flows it reports: 28.9 s to 15.5 s on the same codebase. (#​13539, @​jarstelfox)

Fixes

Taint analysis
  • Unqualified builtin flags in a namespace (ENT_QUOTES, JSON_HEX_TAG) stay known when a library calls define() with a dynamic name, so the escaping they ask for is kept. (#​14949, @​danog)
Assertions and narrowing
  • @psalm-assert-if-true and @psalm-assert-if-false of a remembered call apply when the call is compared with true or false. (#​14605, @​jirkace)
  • A compound assignment in a condition (($s .= "a") === "1a") narrows the variable it assigns. (#​14532, @​jirkace)
  • Asserting a list on a non-empty array gives a non-empty list instead of a false TypeDoesNotContainType. (#​14609, @​jirkace)
  • isset() on a sealed array with a template offset bounded by the array's keys is no longer an InvalidArrayOffset. (#​14603, @​jirkace)
Types and templates
  • A callable-object no longer fits an object shape or a callable-object of another signature. (#​14929, @​MikeFTV)
  • A value given to a template that new left 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.0

Compare Source

Features

  • @psalm-overload: gives a function or method several signatures, and a call returns the result of the first one its arguments fit.
    /**
     * @psalm-overload (LimitedQuery $query): PagedResult
     * @psalm-overload (UnlimitedQuery $query): PlainResult
     */
    function search(Query $query): Result { /* ... */ }
    
    search(new LimitedQuery())->getPageCount();  // no issue
    search(new LimitedQuery())->getAllRecords(); // UndefinedMethod: PagedResult::getAllRecords
    
    See @psalm-overload. Constructors are not supported yet. (#​13353, #​13354, @​jirkace)
  • Database taints:
    • @psalm-database-query ... readonly marks a method that can only run reading queries, so its queries Psalm can't parse store nothing. See the annotation. (#​14860, @​danog)
    • Rows inserted as a list store their values in their own columns. (#​14853, @​danog)
    • ClickHouse: values bound to {name} and {name:Type} query parameters are stored, clauses after the tables of a SELECT are parsed, INSERT ... FORMAT stores its data in the listed columns, and ALTER TABLE ... UPDATE stores like UPDATE. (#​14854, #​14859, #​14857, @​danog)
    • The SQL of 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)
    • phpClickHouse stub: what its queries store and read. (#​14861, @​danog)
  • Taint analysis:
    • A 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)
    • A value put in an XPath string literal is reported only if it can hold a quote. (#​14174, @​danog)
  • Plugin API: Codebase::addTaintedCall() adds calls that PHP code doesn't make (a Twig template calling a filter) to the taint graph, and AddCallTaintsInterface and RemoveCallTaintsInterface handlers run for these calls, which have no Expr. (#​13658, @​danog)

Fixes

Taint analysis
  • Decoders (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
  • A non-falsy-string passed as a callable-string reports ArgumentTypeCoercion. (#​14925, @​orklah)
  • No false UnsafeGenericInstantiation for new static when static is only an array shape key in the return type. (#​14920, @​orklah)
  • A union keeps two conditional return types on the same template, different floats and different template class-strings apart instead of keeping only one. (#​14919, @​orklah)
  • @psalm-assert iterable&Countable keeps Countable, and intersections are compared by every part. (#​14944, @​orklah)
  • $int & <non-negative int> is bounded by the non-negative operand: $i & 0x0F is int<0, 15>. (#​14507, @​jirkace)
  • A literal array is checked against callable-array. (#​13424, @​jirkace)
  • T&Stringable casts to string when T is bounded by object or unbounded, and the cast charges __toString() in pure code. (#​14471, @​jirkace)
  • A class-string-map combined into another array has its template replaced by its bound, and class-string-map<T of Foo, T> keeps its bound in a namespace. (#​14934, @​orklah)
  • An invalid array key message shows the whole key type (list<int>, not array). (#​14923, @​orklah)
Templates
  • A trait method implementing a method of a templated interface is compared with the class's @implements argument, without a false MoreSpecificImplementedParamType. (#​14459, @​jirkace)
  • An argument with no part in a template's bound binds the parts of the bound it contains (non-empty-string, not array|non-empty-string). (#​14582, @​jirkace)
Narrowing, loops and arrays
  • Reassigning $x after $t = gettype($x) unlinks $t, so switch ($t) no longer narrows the new $x to never. (#​14937, @​orklah)
  • $x === $y with $y one of several class-strings keeps all of them. (#​14938, @​orklah)
  • !array_is_list() of a value that is always a list reports TypeDoesNotContainType. (#​14529, @​jirkace)
  • isset($array[$id]) with a string $id on an array with int keys is not an InvalidArrayOffset. (#​14652, @​jirkace)
  • A for or while loop 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)
  • A do/while condition on an offset of a mixed variable no longer holds after the loop. (#​14584, @​jirkace)
  • ?? accepts any left side (null ?? 1, a constant, an operation) without InvalidArgument, and drops its null. (#​14591, @​jirkace)
  • With rememberPropertyAssignmentsAfterCall="false", refinements of readonly properties survive calls. (#​14571, @​jirkace)
Classes, properties and constants
  • A class constant with a native type, read through static:: or an object of a non-final class, has that type instead of mixed. (#​14596, @​jirkace)
  • self in the type of a trait property resolves against the class using it, static in an inherited property type against the class read, and get_object_vars() resolves template-bound literals. (#​14512, @​jirkace)
  • A final class initialises properties through the trait methods it calls, without a false PropertyNotSetInConstructor. (#​14566, @​jirkace)
  • The methods of a class declared inside another statement (if (!class_exists(...)), a function body) in a namespaced file are analysed. (#​13654, @​danog)
  • Code that autoload also loads is no longer treated as unshipped because autoload-dev maps it too. (#​14936, @​danog)
--alter
  • properties-of<T> is written as a native array. (#​14930, @​lyn1dev)
  • Native types hold exactly the values of the type: a refined return type (non-empty-string) gets a docblock, and enums and anonymous class parents get the right namespace. (#​14917, @​orklah)
  • An intersection keeps its docblock when only some of its classes can be declared natively. (#​14918, @​orklah)
  • A string literal with a quote is escaped, and a union bound before [] or inside an intersection is parenthesised. (#​14921, #​14935, @​orklah)

Internal changes

  • Each type writes its own id. Atomic::getId() no longer falls back to getKey(), so a plugin type that extends Atomic must write its id or it throws a LogicException. (#​14922, @​orklah)

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.19.0...7.20.0

v7.19.0

Compare Source

Features

  • @phpstan-sealed is read like @psalm-inheritors. (#​11818, @​stof)
  • Psalm enables psalm/plugin-symfony when composer.json requires any Symfony package, not only symfony/framework-bundle. (#​14682, @​danog)
  • ensureOverrideAttribute also reports MissingOverrideAttribute for a property (PHP 8.5), class constant or enum case (PHP 8.6) that overrides a parent member. (#​14407, @​jirkace)
  • An UndefinedPropertyFetch or UndefinedPropertyAssignment on a property declared by @property in a class without __get()/__set() says to add the magic method or set usePhpDocPropertiesWithoutMagicCall="true". (#​14644, @​jirkace)
  • @psalm-trace works on static properties (self::$name). (#​14629, @​jirkace)

Fixes

Narrowing and conditions
  • Loose == keeps the values PHP juggles: "1" == 1, 1 == 1.0, false == [], $stringable == "a". (#​14906, @​orklah)
  • == 0 keeps the false and null loosely equal to it, so ($h = fopen(...)) == 0 is no longer a ParadoxicalCondition. (#​14823, @​orklah)
  • isset() on an offset of a possibly-null mixed narrows in an elseif as in an if. (#​14393, @​orklah)
  • A contradiction on a variable that an earlier clause also mentions is reported. (#​14828, @​orklah)
  • match (false) narrows the variables of its conditions. (#​14354, @​jirkace)
  • After an early return on $item?->flag !== true, $item is not null. (#​14460, @​jirkace)
  • Narrowing an object to a subclass with instanceof keeps what is known of its properties. (#​14537, @​jirkace)
  • !array_key_exists($key, $array) on a generic array says nothing about $key. (#​14613, @​jirkace)
  • A string or int can be identical to key-of<T> or value-of<T> of a template T of array. (#​14437, @​jirkace)
  • instanceof UnitEnum or BackedEnum excludes 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() (SimpleXMLElement children). (#​14363, @​jirkace)
  • No false ParadoxicalCondition on a clause about a variable that a nested loop writes. (#​14899, @​orklah)
  • An if whose condition on an array offset always holds no longer makes the key optional. (#​14896, @​orklah)
  • With taint analysis on, an array narrowed by isset() in an if keeps the same type as without it. (#​14893, @​orklah)
  • Checking an extension and its functions, several functions of one extension, or functions of newer PHP versions is no longer a RedundantCondition or TypeDoesNotContainType. (#​14822, @​orklah)
  • empty() of a possibly undefined bool is not an InvalidArgument. (#​14819, @​orklah)
  • MixedArrayAccess is reported when a !empty($p['a']) check is stored in a variable first. (#​14824, @​orklah)
  • An exhaustive switch (true) over instanceof checks of final classes is not an InvalidReturnType. (#​13362, @​jirkace)
Loops
  • A while or for loop whose condition holds on entry is always entered. (#​14419, @​jirkace)
  • A variable assigned on the right of && in a for condition is defined in the body and the step. (#​14827, @​orklah)
  • The temporary variable of a switch on a call doesn't stay in scope after it. (#​14569, @​jirkace)
Arrays
  • A write under an unknown key or an append keeps the array shape. (#​14642, @​jirkace)
  • A write under a non-literal key keeps the types of the offsets the key can't be. (#​14825, @​orklah)
  • $array + ['key' => $default] has the keys of the shape, and so does a shape plus an array. (#​14621, @​jirkace)
  • An array created by a nested assignment with an offset ($a[$k][$i] = $v) is non-empty. (#​14404, @​jirkace)
  • Destructurings PHP refuses to compile are reported, as are keys that a sealed shape doesn't have. (#​14604, @​jirkace)
  • An invalid or mixed offset is reported once for $a[$k]++, $a[$k] += 1 and by-reference arguments. (#​14540, @​jirkace)
  • Destructuring or iterating into an item of an ArrayAccess object no longer checks a wrong value against offsetSet(). (#​14371, @​jirkace)
Templates and generics
  • Values read by foreach, array fetches and destructuring from a generic construction resolve their type variables. (#​14897, @​orklah)
  • A conditional return type on a templated list keeps the template through a non-empty-list condition. (#​14830, @​orklah)
  • false records a bound on a type variable like null does. (#​14589, @​jirkace)
  • An argument without a type binds the templates of its param to mixed. (#​14592, @​jirkace)
  • An override without a docblock binds the templates of the param types it inherits. (#​14394, @​jirkace)
  • new on a generic class keeps the template open when inherited public members can constrain it. (#​14448, @​jirkace)
  • A template bound may name a template declared after it. (#​14440, @​jirkace)
  • An inherited @property uses the template arguments of the parent. (#​14530, @​jirkace)
  • A method returning $this with @psalm-this-out returns the @psalm-this-out type. (#​14639, @​jirkace)
  • class-string<T> with @template T as array|object is not an InvalidDocblock. (#​11755, @​vincent4vx)
  • An array<mixed> passed to an iterable<string> param is a MixedArgumentTypeCoercion, and conditional types such as ($iterable is list ? never : list<T>) work again. (#​13329, @​andrew-demb)
  • A callable(never) hint no longer turns a typed closure param into never. (#​14447, @​jirkace)
  • I&static in a final class implementing I is that class. (#​14461, @​jirkace)
Classes, methods and constants
  • A ternary or match whose every branch is $this is $this, and so is tap($this, $callback). (#​14818, #​14895, @​orklah)
  • No false PossiblyNullReference after a call with arguments in a nested nullsafe chain. (#​14850, @​alies-dev)
  • A class using two traits with the same constant gets the first trait's, and method adaptations don't rename constants. (#​14453, @​jirkace)
  • A class constant fetched on a union of classes is checked for each class. (#​14593, @​jirkace)
  • No false AmbiguousConstantInheritance for a constant reached through a parent class and an interface. (#​12663, @​Aerendir)
  • No false OverriddenPropertyAccess when a subclass redeclares a protected property of a native extension class. (#​12052, @​jturbide)
  • An override whose native param type is wider than the parent's keeps the extra types. (#​14817, @​orklah)
  • PossiblyInvalidArgument instead of InvalidArgument when a member of the argument's union is a parent type of the param. (#​14820, @​orklah)
  • Type aliases in inline docblocks resolve when the method is analysed again for a subclass in another file. (#​14627, @​jirkace)
  • An int-mask-of<self::A_*> wildcard ignores constants that aren't integers. (#​14348, @​jirkace)
Purity
  • A stubbed constructor with an empty body (DateTimeImmutable, PDO, Redis, …) is no longer treated as pure. (#​14816, @​orklah)
  • strtr() replacements, array_multisort() with string flags and unpacked implode() arguments charge __toString(). (#​14451, @​jirkace)
  • curl_share_setopt(), imap_timeout() and imap_expunge() are impure. (#​11858, @​ThomasLandauer)
Taint analysis
  • The vprintf() format and curl_setopt() options are read by param, also from named and unpacked arguments. (#​14454, @​jirkace)
  • extract() of a sealed array is no TaintedExtract, and the variables it assigns carry the array's taint. (#​14601, @​jirkace)
Stubs
  • urlencode() and rawurlencode() of a non-empty-string are non-empty. (#​14521, @​jirkace)
  • get_class() combined with other strings is a non-falsy-string. (#​14355, @​jirkace)
  • Ds\Hashable::equals() takes $obj. (#​14373, @​jirkace)
  • The stub images build the bundled extensions (sockets, ldap, imap, …), so MissingExtensionRequirement is reported for them. (#​14686, @​danog)
Messages
  • Issue messages print types with their literals and refinements (RedundantCast, InvalidArrayOffset, InvalidIterator, and any message that includes a union). (#​14903, #​14905, @​orklah)
  • MixedMethodCall names the known type of object and object shapes. (#​14347, @​jirkace)
CLI, config and tools
  • Psalm no longer uses the autoloader of a parent directory in monorepos. (#​11698, @​kkmuffme)
  • Shepherd reports to an endpoint that redirects no longer warn about HTTP 400. (#​14849, @​alies-dev)
  • An option that requires a value rejects an empty one (--threads=). (#​14336, @​jirkace)
  • psalm-refactor rejects destinations PHP reserves as class or constant names. (#​14617, @​jirkace)
  • --alter keeps string refinements (non-empty-string, non-falsy-string) in the docblocks it writes. (#​14913, @​orklah)
Plugin API
  • A FunctionParamsProviderInterface handler returning [] declares no params; return null to leave them unchanged. (#​11622, @​kkmuffme)
  • Union::getKey() is deprecated and will be removed in Psalm 8: use getId() to identify a type. (#​14910, @​orklah)

Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.18.0...7.19.0

v7.18.0: Contravariant templates

Compare 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. A Sink<Animal> fits where a Sink<Dog> is expected, not the other way round, and Psalm reports the template where the class gives a value out.
    /** @template-contravariant T */
    interface Sink {
        /** @param T $value */
        public function put(mixed $value): void;
    
        /** @return T */
        public function last(): mixed; // InvalidTemplateParam
    }
    
    /** @param Sink<Dog> $sink */
    function takesDogSink(Sink $sink): void {}
    
    /** @param Sink<Animal> $animals */
    function f(Sink $animals): void {
        takesDogSink($animals); // no issue
    }
    
    Plugins read the variance with ClassLikeStorage::getTemplateVariance(). See Template contravariance; the templated annotations page was rewritten with checked examples. (#​14669, @​alies-dev)
  • Performance profile: --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.
    vendor/bin/psalm --no-cache --profile=psalm-perf.json
    
    See Finding out why Psalm is slow. (#​14737, #​14769, #​14807, @​alies-dev)
  • Agent skill for Psalm users: skills/psalm teaches AI coding agents to run Psalm, fix its issues, write annotations and edit psalm.xml the way the docs recommend. Install it with npx skills add vimeo/psalm --skill psalm, with the llm/skills Composer plugin, or by copying vendor/vimeo/psalm/skills/psalm into your agent's skills directory. (#​13152, @​roxblnfk; #​14751, @​danog; #​14795, @​roxblnfk)

Performance

Fixes

Templates and type variables
  • new Pipe(fn (int $x) => ...) with a Closure(T): void constructor param caps T at int, so a later $pipe->push('s') is IncompatibleTypeParameters instead of reaching the int callback. (#​14669, @​alies-dev)
  • A covariant template in the bound of a method template (@template U of T) is reported in a param even after an earlier param used U legally. (#​14669, @​alies-dev)
  • Callbacks over a widened type variable (new Coll([1]), then $c->add('x')) see every value it holds, not only the construction-site ones. (#​14551, @​shu-chen-dot-ca)
  • null no longer fits a template without a bound: fn() => null for callable(): T, [null] for list<T>. (#​14550, @​shu-chen-dot-ca)
  • Trait method params use the types given to @use. (#​13429, @​jirkace)
  • @implements Wrapper<static> resolves static to 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)
  • An implementation with the same conditional return type as its interface method is not an ImplementedReturnTypeMismatch. (#​14502, @​jirkace)
  • A conditional return type reads an argument that does not fit its param as it is (preg_replace() on an array of Stringable returns an array). (#​14421, @​jirkace)
  • A template array T read at a key-of<T> offset is value-of<T>. (#​14586, @​jirkace)
  • is_int(), is_scalar() and similar checks narrow a template bounded by scalar, numeric, array-key or an int range instead of reporting DocblockTypeContradiction. (#​14545, @​jirkace)
  • A literal class name can be identical to a template class-string<T>. (#​14365, @​jirkace)
  • Iterating a star-projected collection (Coll<*>) gives the template's bound instead of mixed. (#​14666, @​alies-dev)
  • Generated stubs keep @template, the variance and the declared order of templates instead of marking every template @template-covariant. (#​14669, @​alies-dev)
Narrowing and arrays
  • $a !== $b with several possible values of $b doesn't exclude them all from $a. (#​14525, @​jirkace)
  • After isset($array[$k]) with $k one of several literal keys, $array[$k] is the value of those keys. (#​14646, @​jirkace)
  • $arr[$key] stays known to be set when $key is narrowed inside if (isset($arr[$key])). (#​13344, @​jirkace)
  • InvalidArrayOffset is reported when an item is read again under an index narrowed to a key the array can't have. (#​14767, @​orklah)
  • ($a ?? null) !== null asserts isset($a). (#​14517, @​jirkace)
  • instanceof a 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)
  • A property of an object intersected with an object shape (V&object{x: string}) has the type of both. (#​14546, @​jirkace)
  • With ensureArray*OffsetsExist, an offset that may be one of several literals is set only when each of them is. (#​14606, @​jirkace)
  • Appends stop growing a list shape at maxShapedArraySize. (#​14641, @​jirkace)
  • Quoted keys of an array shape are read as PHP string literals ("a\r\nb"). (#​14600, @​jirkace)
  • No crash on PHP 8.5 for an array key that reads as a huge number, such as the UUID '6e5212ed-…' in Symfony's Form constraint. (#​14797, @​leonardsimonse)
  • pow() of two int literals is an int literal. (#​14505, @​MikeFTV)
Control flow
  • A variable unset before a continue or break is possibly undefined after the loop. (#​14509, @​jirkace)
  • A property or offset narrowed before a loop forgets the narrowing after a break that reassigned it. (#​14456, @​jirkace)
  • Variables assigned in the left operand of a negated && are defined in the next operands of the enclosing &&. (#​14409, @​jirkace)
  • A superglobal assigned on some paths only keeps its default type on the others. (#​14406, @​jirkace)
  • A closure that falls through after a throw or exit in a branch returns void, not never. (#​14793, @​MikeFTV)
  • The return of a required file keeps the use of the outer return, so it is no UnusedFunctionCall. (#​14562, @​jirkace)
Callables and nullsafe calls
  • Arguments of a call after a ?-> in a chain are analysed with a non-null receiver, as PHP skips the whole chain when it is null. (#​14608, @​jirkace)
  • The if-true assertions of a method called with ?-> apply where the call is truthy. (#​14531, @​jirkace)
  • An enum case with __invoke() is callable. (#​14590, @​jirkace)
  • A first-class callable of a method that an unsealed class forwards to __call() is not an UndefinedMagicMethod. (#​14411, @​jirkace)
  • static in closure hints of calls in a trait on other objects resolves to that object. (#​14446, @​jirkace)
  • A Closure object of unknown signature is a Closure. (#​14599, @​jirkace)
  • No crash on a callable array whose object intersects a template. (#​14594, @​jirkace)
  • yield from forwards the send type of the inner generator. (#​14340, @​jirkace)
Reported issues
  • A value that shares only null or false with the expected type is InvalidArgument, not PossiblyInvalidArgument, in closure params of array_map() and similar functions and in __set() calls on a @property. (#​14742, @​orklah)
  • ParadoxicalCondition on a dead || operand next to other values of the same variable. (#​14821, @​orklah)
  • No ParamNameMismatch for a name another overridden method uses. (#​14536, @​jirkace)
  • No MethodSignatureMismatch for @no-named-arguments on parameterless methods. (#​14799, @​orklah)
  • A write through a set hook is checked against the hook's param type. (#​14538, @​jirkace)
  • Properties that array_column() reads are used. (#​14560, @​jirkace)
  • Before PHP 8.6, unsetting, passing by reference or referencing a property of a constant object is reported. (#​14519, @​jirkace)
  • @implements naming an interface the class doesn't implement gets the same message with or without type arguments. (#​14650, @​jirkace)
  • @psalm-suppress before the expression of echo or <?= is read. (#​14527, @​jirkace)
Stubs
CLI, config and tools

Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.17.0...7.18.0

v7.17.0

Compare Source

What's Changed

Features
Fixes
  • fix(class-string): get_parent_class() without an argument is bound to the parent class by @​jirkace in #​14316
  • fix(property-map): ShellExec::$parts and MatchArm::$conds match php-parser v5 by @​jirkace in #​14341
  • fix(assertion): count() compared to a constant narrows like a literal by @​jirkace in #​14323
  • fix(cli): a missing root directory is shown as given when it is absolute by @​jirkace in #​14345
  • fix(foreach): the iterated expression is analysed once for getIterator() by @​jirkace in #​14370
  • fix(property): an offset write initializes an uninitialized array property by @​jirkace in #​14358
  • fix(docblock): @​psalm-import-type is read from any docblock before the class by @​jirkace in #​14328
  • fix(unused-code): a method verified to return $this has no unused return value by @​jirkace in #​14337
  • fix(combiner): a non-empty array and a Traversable are not combined into iterable by @​jirkace in #​14425
  • fix(stubs): ArrayObject and ArrayIterator use the PHP 8 parameter names by @​jirkace in #​14324
  • fix(arithmetic): int ** int may be a float when the exponent may be negative by @​jirkace in #​14317
  • fix(stubs): strtolower and mb_strtolower of string literals are the lowercased literals by @​jirkace in #​14321
  • fix(isset): keep the array value type when an ArrayAccess object is a union alternative by @​jirkace in #​13118
  • fix(templates): new of the class itself binds its templates from the arguments by @​jirkace in #​13425
  • fix(assertion): !== a bool literal of a template bounded by mixed is possible by @​jirkace in #​14362
  • fix(enum): report a circular reference of an enum case value instead of crashing by @​jirkace in #​14350
  • fix(switch): continue N targeting an outer switch leaves it like break N by @​jirkace in #​14368
  • fix(comparison): loose comparison of numeric string literals compares their numbers by @​jirkace in #​14369
  • fix(loop): a variable assigned in the right operand of || is defined after a while loop left through its condition by @​jirkace in #​14396
  • fix(baseline): a character XML 1.0 forbids in the selected text keeps the baseline loadable by @​jirkace in #​14352
  • fix(arrays): a nested write under a key a list doesn't have creates the offset by @​jirkace in #​14434
  • fix(templates): a template of numeric can be identical to a string by @​jirkace in #​14430
  • fix(override): #[\Override] on a property without a parent property is an InvalidOverride by @​jirkace in #​14390
  • fix(algebra): a falsy variable holding a condition narrows to its negation by @​jirkace in #​14441
  • fix(class_exists): the code after an if chain knows the classes of every block that reaches it by @​jirkace in #​14435
  • fix(constant): use const imports win over the PHP constant of the same name by @​jirkace in #​14325
  • fix(docblock): a param docblock of an implementation keeps the inherited return type by @​jirkace in #​14360
  • fix(try): a variable assigned on some paths of a finally block keeps that type after the try by @​jirkace in #​14416
  • fix(list): a write under the key array_key_last() returned for a list keeps it a list by @​jirkace in #​14428
  • fix(templates): an int range bound to a constructor-only template stays open by @​jirkace in #​12944
  • Fix --generate-stubs signatures for intersections, true/never/static/parent, enums and readonly by @​shu-chen-dot-ca in #​14114
  • Fix assertions on $this of calls with no object, and make call-site InvalidDocblock suppressible by @​orklah in #​14678
  • Expand the params of a final class's method with its static as the class itself by @​shu-chen-dot-ca in #​14203
  • Write through an ArrayAccess item of an array with its offsetSet() by @​danog in #​14422
  • Taint the items destructured from a mixed value or an ArrayAccess object by @​danog in #​14225
  • Report the extensions the PHP 8.6 stub image doesn't build yet by @​danog in #​14683
  • Check the extension of a symbol in every PHP version composer.json allows by @​danog in #​14685
  • Give a foreach over an IteratorAggregate the taints of what getIterator() returns by @​danog in #​14687
  • Keep the intersection of a template return type resolved to object by @​danog in #​14684
  • Report the sinks of PDO and other extensions composer.json doesn't require by @​danog in #​14688
  • Fix master CI by @​danog in #​14689
  • fix(reconciliation): is_callable() leaves out a template whose bound can't be callable by @​jirkace in #​14622
  • fix(report): by-issue-level shows (always) and (feature) for errors without a numeric level by @​jirkace in #​14632
  • fix(arrays): a destructuring condition rules out the null a null value gives its variables by @​jirkace in #​14607
  • refactor(methods): remove the unreachable CallMap fallback of compareMethodSignatureParams() by @​jirkace in #​14612
  • fix(baseline): --update-baseline drops a duplicated code sample fixed once by @​jirkace in #​14561
  • fix(stubs): Ds\Vector and Ds\Deque declare the mutating methods of Sequence by @​jirkace in #​14645
  • fix(callables): match native callback functions case-insensitively by @​jirkace in #​14513
  • fix(stubs): array_product() of booleans is 0|1 by @​jirkace in #​14634
  • fix(reconciler): a string with a set offset is non-empty by @​jirkace in #​14638
  • fix(types): too many non-empty literal strings combine into a non-empty string by @​jirkace in #​14640
  • fix(traits): report an alias or precedence rule for a method the traits don't have by @​jirkace in #​14626
  • fix(templates): a class-string-map is read and written with a literal Foo::class offset by @​jirkace in #​14616
  • fix(stubs): preg_grep() can return false by @​jirkace in #​14574
  • fix(reconciler): an object whose class is not a final class is not of it by @​jirkace in #​14548
  • fix(new): report new of internal classes that can't be instantiated by @​jirkace in #​14570
  • fix(assertions): a bare post-increment or decrement condition narrows the variable by @​jirkace in #​14534
  • fix(loops): a variable the condition always writes holds what the breaks or the condition leave by @​jirkace in #​14541
  • fix(foreach): a value variable bound by reference to the items of a property is limited to their type by @​jirkace in #​14583
  • Follow taint through the builtin parameters PHP 8.0 renamed, when analysing for older versions by @​danog in #​14696
  • fix(properties): keep analysing after an invalid static property assignment by @​jirkace in #​14515
  • Fix: Shepherd reads local files for non-HTTP endpoints by @​alies-dev in #​14728
  • Fix crash on a typeless @​property, @​global or @​param-out tag with its name on the next line by @​orklah in #​14704
  • Fix Psalter ignoring autoloader and extraFiles when given a single path by @​orklah in #​14708
  • Share the value-vs-expected-type issue tree between arguments, returns and properties (experimental) by @​orklah in #​14727
  • Resolve static in the assertions of static calls by @​orklah in #​14721
  • Report PossiblyInvalidPropertyFetch for @​property and __get() reads on unions with non-objects by @​orklah in #​14706
  • Keep the extra key and value types of unsealed shapes in @​method and --alter by @​orklah in #​14718
  • Narrow callable and iterable through their parts in is_countable() by @​orklah in #​14712
  • Compare every entry of an array shape the same way by @​orklah in #​14719
  • Suggest a trait method's purity annotation for every class using it by @​orklah in #​14717
  • Share the property access checks of reads and writes by @​orklah in #​14711
  • Share the CLI entry points' bootstrap and fix psalter/psalm-refactor drifts by @​orklah in #​14705
  • Fix the sign and an overflow crash in int range multiplication by @​orklah in #​14702
  • Keep useStrictTypes/ignoreTypeStats on symlinked project directories by @​orklah in #​14698
  • Fall back to normal inference when a PhpStorm meta function override does not apply by @​orklah in #​14701
  • fix(purity): eval() requires the impure capability by @​jirkace in #​14506
  • Show where the type of a Mixed* issue comes from in the PhpStorm report by @​orklah in #​14699
  • Share the steps instance and static method calls have in common (experimental) by @​orklah in #​14703
  • fix(loops): for without a condition and while with a truthy literal are only left by a break by @​jirkace in #​14462
  • fix(docblock): two generic interfaces resolving to the same return type document the implementation by @​jirkace in #​14445
  • fix(reflection): take finality of reflected native classes and methods by @​jirkace in #​14508
  • fix(loops): a property read in a loop feeds the property assigned from it by @​jirkace in #​14450
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.16.0...7.17.0

v7.16.0: Star projection

Compare Source

Features

Performance

  • Scan workers send back only the stubs they added: −9 % wall, −14 % memory on a large Laravel app (8 threads, no cache). (#​12558, @​alies-dev)
  • Usage-inferred parameter types are recorded only for methods in the project directories: −8 to −15 % wall on apps that analyse their tests (one thread). (#​13901, @​alies-dev)
  • No exponential clause growth in || chains of str_starts_with(). Important for WordPress projects (#​14653, @​alies-dev)
  • Config loading skips directories a ** entry already matched: 60 to 85 % faster with **/vendor-style entries. (#​14624, @​alies-dev)
  • A class docblock is split into lines once for all its @method tags: scanning up to 5 % faster on classes with hundreds of them, such as AWS SDK clients and Laravel Facades. (#​14620, @​alies-dev)

Fixes

Templates
  • An inherited property or callable resolves the parent's template through what the child passes to it (@extends Base<list<U>>, @extends Base<Box<TModel>>, also across two @extends levels). (#​14487 @​jirkace, #​14558 @​alies-dev)
  • Callables of a non-generic child of a generic class bind the parent's template. (#​14578, @​alies-dev)
  • new on a @template-covariant class infers never for a template nothing can constrain, so new Coll() fits Coll<int>. (#​14449, @​jirkace)
Callables and invokable objects
  • An intersection whose later member has __invoke is callable. (#​14610, @​alies-dev)
  • array_map() with an invokable object as the callback infers the return type of __invoke instead of list<mixed>. (#​14654, @​alies-dev)
  • An invokable object, a function name or an array passed where a Closure is expected is an ArgumentTypeCoercion, not an InvalidArgument. (#​14657, @​alies-dev)
Other

Docs

  • Docs examples are self-contained and declare the config they need. (#​14585, @​danog)

Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.15.0...7.16.0

v7.15.0

Compare Source

What's Changed

Features
  • Give Closure::getCurrent() the signature of the closure it is called in by @​danog in #​14467
  • Report native constants newer than the analysed PHP version by @​danog in #​14478
Fixes
  • Date native symbols from a generated dictionary instead of loading every callmap by @​danog in #​14464
  • Charge io for the pgsql, pcntl and posix functions that use the server, the process or the system by @​danog in #​14465
  • Keep the callmap return type of a builtin whose stub declares none by @​danog in #​14466
  • Let a lazy ghost initializer call the constructor of the object it is given by @​danog in #​14470
  • Read C::{$name} like C::NAME when $name holds literal names by @​danog in #​14468
  • Don't crash on a static call of a native method newer than the runtime by @​danog in #​14479
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.14.0...7.15.0

v7.14.0

Compare 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.2

Compare Source

What's Changed

Fixes
  • Don't prefix PHP's Io namespace in the phar (crash on PHP 8.6 with threads) by @​danog in #​14414
  • Don't crash combining type variables that all stand for never until bound by @​danog in #​14379
  • Report only the ternary's own negated condition as redundant by @​danog in #​14417
  • Keep the template arguments of the object in callable($this) and callable(static) params by @​danog in #​14423

Full Changelog: https://github.com/vimeo/psalm/compare/7.13.1...7.13.2

v7.13.1

Compare Source

What's Changed

Fixes
  • Fix template arguments of a parent named in another case, share @​extends/@​implements/@​use scanning by @​orklah in #​14397
  • fix(assertion): a redundant negated assertion on a template keeps the template by @​jirkace in #​14330
  • Share the template and result code of negated type assertions by @​orklah in #​14408
  • Count a write through an ArrayAccess offset as a use of the object by @​danog in #​14410

Full Changelog: https://github.com/vimeo/psalm/compare/7.13.0...7.13.1

v7.13.0

Compare 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)

  • Branch creation
    • Between 12:00 AM and 05:59 AM, only on Monday (* 0-5 * * 1)
  • 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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [vimeo/psalm](https://github.com/vimeo/psalm) | `7.12.0` → `7.22.1` | ![age](https://developer.mend.io/api/mc/badges/age/packagist/vimeo%2fpsalm/7.22.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/vimeo%2fpsalm/7.12.0/7.22.1?slim=true) | --- ### Release Notes <details> <summary>vimeo/psalm</summary> ### [`v7.22.1`](https://github.com/vimeo/psalm/releases/tag/7.22.1) [Compare Source](https://github.com/vimeo/psalm/compare/7.22.0...7.22.1) <!-- Release notes generated using configuration in .github/release.yml at 9a62015d2e17c4d4a8f5299f503bfcc889920e00 --> #### What's Changed ##### Fixes - Locate docblock issues on the tag's line when the node has no doc comment by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15119](https://github.com/vimeo/psalm/pull/15119) - Follow the writes inside compound assignments in loops by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15123](https://github.com/vimeo/psalm/pull/15123) - Report undefined classes inside key-of<…> and object\&callable(…) by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15128](https://github.com/vimeo/psalm/pull/15128) - Keep side effects when the UnusedVariable fixer removes an assignment by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15124](https://github.com/vimeo/psalm/pull/15124) - Memoize trait methods with the capabilities of the class using the trait by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15133](https://github.com/vimeo/psalm/pull/15133) - Fix stale state in MutableUnion by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15126](https://github.com/vimeo/psalm/pull/15126) - Keep the taints of a value narrowed to a union with a scalar part by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15129](https://github.com/vimeo/psalm/pull/15129) - Keep class-like strings after a negated class_exists() by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15139](https://github.com/vimeo/psalm/pull/15139) - Infer TReturn null for a generator ending without a value by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15140](https://github.com/vimeo/psalm/pull/15140) - Fix false PossiblyInvalidArrayOffset past an int offset of a mixed value checked with isset() by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15142](https://github.com/vimeo/psalm/pull/15142) ##### Internal changes - Fix `TNamedObject::setValueIsStatic()` ignoring `$is_static_resolved` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15127](https://github.com/vimeo/psalm/pull/15127) - Check PSR-4 for test classes in CI and fix the 21 that fail it by [@&#8203;samsonasik](https://github.com/samsonasik) in [#&#8203;14766](https://github.com/vimeo/psalm/pull/14766) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.22.0...7.22.1> ### [`v7.22.0`](https://github.com/vimeo/psalm/releases/tag/7.22.0): Call-site variance [Compare Source](https://github.com/vimeo/psalm/compare/7.21.1...7.22.0) New AI, UX and `@template` syntax features. #### Features - **Call-site variance**: `covariant` or `contravariant` before a type argument makes one param accept a generic of any subtype (or supertype) of it, without changing the class's template. As with `Box<*>`, values then go one way only: from a `Box<covariant Node>` you read `Node`, but can't put anything in. ([#&#8203;15096](https://github.com/vimeo/psalm/issues/15096), [@&#8203;alies-dev](https://github.com/alies-dev)) ```php /** @param Handler<covariant Node> $handler */ function register(Handler $handler): void {} register(new LeafHandler()); // a Handler<LeafNode>: no issue (was InvalidArgument) ``` - **`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. ([#&#8203;15066](https://github.com/vimeo/psalm/issues/15066), [@&#8203;alies-dev](https://github.com/alies-dev), [@&#8203;roxblnfk](https://github.com/roxblnfk)) ```bash vendor/bin/psalm --explain=PossiblyNullArgument vendor/bin/psalm --explain=078 vendor/bin/psalm --explain=https://psalm.dev/078 ``` - **AI coding agents**: when Psalm runs under an agent (`CLAUDECODE`, `CURSOR_AGENT`, `CODEX_THREAD_ID`, `AI_AGENT`, …), it prints the `compact` format (one line per issue), no progress output even if `CI` is set, a one-line result (also `0 issues`), and `[*]` after each issue `--alter` can fix. An explicit `--output-format` wins, and nothing changes outside an agent. See [AI agents](https://psalm.dev/docs/running_psalm/ai_agents/). ([#&#8203;15068](https://github.com/vimeo/psalm/issues/15068), [#&#8203;15069](https://github.com/vimeo/psalm/issues/15069), [#&#8203;15067](https://github.com/vimeo/psalm/issues/15067), [@&#8203;alies-dev](https://github.com/alies-dev)) - **Crash reports** name the plugin and hook that threw and the statement Psalm was analysing, save the full report to a file, and print a link that opens a prefilled issue on Psalm's or the plugin's tracker. ([#&#8203;15070](https://github.com/vimeo/psalm/issues/15070), [@&#8203;alies-dev](https://github.com/alies-dev)) - **`--no-taint-analysis`** skips taint analysis for one run (`runTaintAnalysis` is on by default), e.g. for a quick local check ([#&#8203;15078](https://github.com/vimeo/psalm/issues/15078), [@&#8203;orklah](https://github.com/orklah)). - **New issues**: - `InternalFunction` for a call of an `@internal` or `@psalm-internal` function from outside its namespace. ([#&#8203;15084](https://github.com/vimeo/psalm/issues/15084), [@&#8203;orklah](https://github.com/orklah)) - `ParseError` for constructor property promotion when analysing PHP 7.x. ([#&#8203;15086](https://github.com/vimeo/psalm/issues/15086), [@&#8203;orklah](https://github.com/orklah)) - **`--alter` on PHP 8.2** writes `true`, `false` and `null` as native types (`: true|null` instead of `: bool|null` plus a docblock), and no longer adds docblocks that repeat a native type. ([#&#8203;15083](https://github.com/vimeo/psalm/issues/15083), [@&#8203;orklah](https://github.com/orklah)) #### Performance - Narrowing a variable no longer copies the whole scope for every other variable, which made 7.18 about 2% slower than 7.17. ([#&#8203;15121](https://github.com/vimeo/psalm/issues/15121), [@&#8203;alies-dev](https://github.com/alies-dev)) #### Fixes ##### Taint analysis - `TaintedCallable` for a tainted method name: `$object->$name()`, `A::$name()`. ([#&#8203;15072](https://github.com/vimeo/psalm/issues/15072), [@&#8203;alies-dev](https://github.com/alies-dev)) - `strip_tags()` with allowed tags is not an html escape: `strip_tags($_GET["x"], "<a>")` is `TaintedHtml`. ([#&#8203;14753](https://github.com/vimeo/psalm/issues/14753), [@&#8203;arpitjain099](https://github.com/arpitjain099)) ##### Stubs and plugins - A stub's `@return` (or its own `@psalm-overload`) replaces the original's `@return $this` and overloads, so a stubbed call returns the stub's type again (a 7.19.0 regression). ([#&#8203;15090](https://github.com/vimeo/psalm/issues/15090), [@&#8203;alies-dev](https://github.com/alies-dev)) - No false `MethodSignatureMismatch` for an override that widens a param of a stubbed userland class, and `float`/`int` swaps PHP rejects are reported. ([#&#8203;15114](https://github.com/vimeo/psalm/issues/15114), [@&#8203;orklah](https://github.com/orklah)) - `[]` on `Ds\Map`, `Ds\Vector` and other Ds collections is typed and checked, and a stub class that leaves out a method of its interfaces still has it. ([#&#8203;15039](https://github.com/vimeo/psalm/issues/15039), [@&#8203;orklah](https://github.com/orklah)) - A function params provider returning `null` keeps the function's params checked. ([#&#8203;15040](https://github.com/vimeo/psalm/issues/15040), [@&#8203;orklah](https://github.com/orklah)) - Params providers can resolve `[$this, 'method']`: `CallAnalyzer::getFunctionIdsFromCallableArg()` takes the call's `Context`. ([#&#8203;15082](https://github.com/vimeo/psalm/issues/15082), [@&#8203;orklah](https://github.com/orklah)) - A return type provider of a class wins over its `@mixin` for a method behind `__call()`/`__callStatic()`. ([#&#8203;15020](https://github.com/vimeo/psalm/issues/15020), [@&#8203;shu-chen-dot-ca](https://github.com/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 nested `isset($a["x"][3])` narrows `$a["x"]`. ([#&#8203;15103](https://github.com/vimeo/psalm/issues/15103), [#&#8203;15104](https://github.com/vimeo/psalm/issues/15104), [#&#8203;15105](https://github.com/vimeo/psalm/issues/15105), [#&#8203;15076](https://github.com/vimeo/psalm/issues/15076), [@&#8203;orklah](https://github.com/orklah)) - A `switch` case is analysed knowing the cases before it didn't match. ([#&#8203;14528](https://github.com/vimeo/psalm/issues/14528), [@&#8203;jirkace](https://github.com/jirkace)) - Assigning an offset to a possibly-null array keeps the other offsets optional, and a nested write under a listed key of a shape with a `mixed` fallback keeps that key's type. ([#&#8203;14815](https://github.com/vimeo/psalm/issues/14815), [#&#8203;14611](https://github.com/vimeo/psalm/issues/14611), [@&#8203;jirkace](https://github.com/jirkace)) - `is_int()`, `is_bool()` and `is_string()` keep the emptiness of `empty-scalar` and `non-empty-scalar`. ([#&#8203;14431](https://github.com/vimeo/psalm/issues/14431), [@&#8203;jirkace](https://github.com/jirkace)) - `is_callable()` on a list can be true. ([#&#8203;14319](https://github.com/vimeo/psalm/issues/14319), [@&#8203;jirkace](https://github.com/jirkace)) - No `MixedAssignment`/`MixedArgument` in a `foreach` over an always-empty list, such as `list<T>` of a `new` covariant generic. ([#&#8203;15095](https://github.com/vimeo/psalm/issues/15095), [@&#8203;alies-dev](https://github.com/alies-dev)) ##### Types and templates - The false branch of a conditional type bounds the template by the rest of its bound. ([#&#8203;14647](https://github.com/vimeo/psalm/issues/14647), [@&#8203;jirkace](https://github.com/jirkace)) - `value-of<T>` of a backed enum template is an array key, and `$case->value` of a `T` is a `value-of<T>`. ([#&#8203;14618](https://github.com/vimeo/psalm/issues/14618), [@&#8203;jirkace](https://github.com/jirkace)) - An intersection merges its object shapes (`Card&object{last4: string}&object{brand: string}`). ([#&#8203;14457](https://github.com/vimeo/psalm/issues/14457), [@&#8203;jirkace](https://github.com/jirkace)) - An argument may fit any declaration of a method that several members of an intersection declare. ([#&#8203;14977](https://github.com/vimeo/psalm/issues/14977), [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca)) - `static` in the params of a `@method` tag resolves to the called class. ([#&#8203;14480](https://github.com/vimeo/psalm/issues/14480), [@&#8203;jirkace](https://github.com/jirkace)) - `void|never` is `void`, not `null`: `AssignmentToVoid` is reported, and an always-exiting function is no `InvalidReturnType`. ([#&#8203;15087](https://github.com/vimeo/psalm/issues/15087), [@&#8203;orklah](https://github.com/orklah)) - `pow()` with a zero and a float operand is a float. ([#&#8203;14845](https://github.com/vimeo/psalm/issues/14845), [@&#8203;ARAYN7011](https://github.com/ARAYN7011)) - `PHP_INT_MIN` is negative, `PHP_DEBUG`/`PHP_ZTS` are `0|1` (`bool` since PHP 8.4), and `$_SERVER["DOCUMENT_ROOT"]`, `["SCRIPT_FILENAME"]` and `["PATH_TRANSLATED"]` can be empty. ([#&#8203;15079](https://github.com/vimeo/psalm/issues/15079), [#&#8203;15092](https://github.com/vimeo/psalm/issues/15092), [@&#8203;orklah](https://github.com/orklah)) - `get_object_vars()` doesn't include static properties. ([#&#8203;15011](https://github.com/vimeo/psalm/issues/15011), [@&#8203;jirkace](https://github.com/jirkace)) ##### Functions, classes and properties - No false `PropertyNotSetInConstructor` for a redeclared promoted property or one assigned through `$this->$name`. ([#&#8203;15038](https://github.com/vimeo/psalm/issues/15038), [@&#8203;orklah](https://github.com/orklah)) - Overriding a property of a builtin class with its native type is no `NonInvariantPropertyType`. ([#&#8203;14623](https://github.com/vimeo/psalm/issues/14623), [@&#8203;jirkace](https://github.com/jirkace)) - Calling a closure forgets the properties of `$this` it writes, and a by-reference capture gets what the closure leaves in it. ([#&#8203;15048](https://github.com/vimeo/psalm/issues/15048), [#&#8203;15052](https://github.com/vimeo/psalm/issues/15052), [@&#8203;danog](https://github.com/danog)) - No false `ReferenceConstraintViolation` for a reference rebound before a `break` or in a `switch` case. ([#&#8203;13710](https://github.com/vimeo/psalm/issues/13710), [@&#8203;jirkace](https://github.com/jirkace)) - The body is still analysed after `MismatchingDocblockReturnType`. ([#&#8203;13213](https://github.com/vimeo/psalm/issues/13213), [@&#8203;jirkace](https://github.com/jirkace)) - An always-exiting function with a native return type is `InvalidReturnType` on PHP 8.1+. ([#&#8203;15081](https://github.com/vimeo/psalm/issues/15081), [@&#8203;orklah](https://github.com/orklah)) - `global $x` in a function has the type declared in `<globals>`. ([#&#8203;15116](https://github.com/vimeo/psalm/issues/15116), [@&#8203;orklah](https://github.com/orklah)) ##### Scanning and includes - `require` of a ternary between two paths is resolved, and the files a dependency requires through one are scanned (Carbon 3's `CarbonPeriod`). ([#&#8203;15094](https://github.com/vimeo/psalm/issues/15094), [@&#8203;bardrop](https://github.com/bardrop); [#&#8203;15080](https://github.com/vimeo/psalm/issues/15080), [@&#8203;orklah](https://github.com/orklah)) - With several scan threads, an autoloaded class is no longer replaced by a project file that redeclares it (IDE helpers). ([#&#8203;15077](https://github.com/vimeo/psalm/issues/15077), [@&#8203;orklah](https://github.com/orklah)) - `ssh2_*` functions belong to ext-ssh2, not ext-swoole. ([#&#8203;15106](https://github.com/vimeo/psalm/issues/15106), [@&#8203;orklah](https://github.com/orklah)) ##### CLI and config - A file that changes during a run stops it with `src/C3.php changed while Psalm was running. Run Psalm again.` instead of a crash, and a worker crash is printed once. ([#&#8203;15061](https://github.com/vimeo/psalm/issues/15061), [@&#8203;alies-dev](https://github.com/alies-dev)) - `-c` with a directory or an empty path reports `Cannot read the config file` instead of crashing. ([#&#8203;14947](https://github.com/vimeo/psalm/issues/14947), [@&#8203;tlq5l](https://github.com/tlq5l)) - `config.xsd` accepts `allowMissingFiles` on `<projectFiles>`, `<extraFiles>` and `<errorLevel>`. ([#&#8203;15037](https://github.com/vimeo/psalm/issues/15037), [@&#8203;orklah](https://github.com/orklah)) #### Docs - `allowMissingFiles` and the `*`/`**` path patterns. ([#&#8203;15037](https://github.com/vimeo/psalm/issues/15037), [@&#8203;orklah](https://github.com/orklah)) - `SecurityIssue` in `<unsuppressibleIssues>` keeps every security issue reported. ([#&#8203;15074](https://github.com/vimeo/psalm/issues/15074), [@&#8203;danog](https://github.com/danog)) #### Internal changes - CI: cancel superseded branch runs, start unit tests without the chunk-matrix job, refresh test times weekly, a 6× faster slowest test, and Windows-safe collector timing tests. ([#&#8203;15024](https://github.com/vimeo/psalm/issues/15024), [#&#8203;15029](https://github.com/vimeo/psalm/issues/15029), [#&#8203;15030](https://github.com/vimeo/psalm/issues/15030), [#&#8203;15032](https://github.com/vimeo/psalm/issues/15032), [#&#8203;15031](https://github.com/vimeo/psalm/issues/15031), [@&#8203;alies-dev](https://github.com/alies-dev)) #### New Contributors - [@&#8203;arpitjain099](https://github.com/arpitjain099) made their first contribution in [#&#8203;14753](https://github.com/vimeo/psalm/issues/14753) - [@&#8203;tlq5l](https://github.com/tlq5l) made their first contribution in [#&#8203;14947](https://github.com/vimeo/psalm/issues/14947) - [@&#8203;bardrop](https://github.com/bardrop) made their first contribution in [#&#8203;15094](https://github.com/vimeo/psalm/issues/15094) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.21.1...7.22.0> ### [`v7.21.1`](https://github.com/vimeo/psalm/releases/tag/7.21.1) [Compare Source](https://github.com/vimeo/psalm/compare/7.21.0...7.21.1) #### Fixes ##### Taint analysis - No crash ("Undefined array key -1") when an array whose values a `foreach` wrote back under their keys reaches a cast. ([#&#8203;14965](https://github.com/vimeo/psalm/issues/14965), [@&#8203;orklah](https://github.com/orklah)) - An unpacked element taints only the parameter it fills: in `f(...[safe(), $_GET['x']])`, `$first` is no longer tainted. ([#&#8203;14979](https://github.com/vimeo/psalm/issues/14979), [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca)) - What `array_walk()` and `array_walk_recursive()` callbacks write to their by-reference param flows into the array. ([#&#8203;14963](https://github.com/vimeo/psalm/issues/14963), [@&#8203;danog](https://github.com/danog)) ##### Templates and type variables - `class-string<T>`, `key-of<T>`, `value-of<T>`, `T[K]` and `properties-of<T>` resolve when `new` binds the template: `(new ReflectionClass(new stdClass()))->getName()` is `class-string<stdClass>`. An inherited `self<T&C>` assertion narrows a subclass again. ([#&#8203;14981](https://github.com/vimeo/psalm/issues/14981), [@&#8203;orklah](https://github.com/orklah)) - No infinite recursion when an object is added to its own template, and `properties-of<T>` over several classes includes the properties of each. ([#&#8203;14982](https://github.com/vimeo/psalm/issues/14982), [@&#8203;orklah](https://github.com/orklah)) - A `class-string<T>|T` param given a class string binds `T` to the class only, without a false `IncompatibleTypeParameters`. ([#&#8203;14994](https://github.com/vimeo/psalm/issues/14994), [@&#8203;orklah](https://github.com/orklah)) - No hang when a class with `@template T of static` calls a method returning `T` on `$this` or `static::`. ([#&#8203;14978](https://github.com/vimeo/psalm/issues/14978), [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca)) ##### Narrowing, loops and arrays - `$x != ""` and `$x != 0` remove `null` and the loosely equal bool from `$x`. ([#&#8203;14995](https://github.com/vimeo/psalm/issues/14995), [@&#8203;orklah](https://github.com/orklah)) - A variable that a nested `foreach` over a non-empty list assigns before every `break` is defined after it. ([#&#8203;12439](https://github.com/vimeo/psalm/issues/12439), [@&#8203;jarstelfox](https://github.com/jarstelfox)) - A variable read where it is undefined is no longer possibly undefined on the loop's next iteration, and with `extract()` a variable assigned on one path is no longer read as possibly undefined. ([#&#8203;12442](https://github.com/vimeo/psalm/issues/12442), [@&#8203;jarstelfox](https://github.com/jarstelfox)) - No false `PossiblyUndefinedVariable` on `$r?->m() ?? []`, or `TypeDoesNotContainNull` on `$r?->p ?? []`, when `$r` may be undefined. ([#&#8203;14998](https://github.com/vimeo/psalm/issues/14998), [@&#8203;orklah](https://github.com/orklah)) - A list written under keys it already has (its own `foreach` key, `array_key_last()`) keeps its shape. ([#&#8203;15009](https://github.com/vimeo/psalm/issues/15009), [@&#8203;orklah](https://github.com/orklah)) - `$a + [...]` combined with a shape: no false `PossiblyUndefinedArrayOffset` on keys both declare, and no `InvalidArgument` when it is passed to a sealed shape param. ([#&#8203;15002](https://github.com/vimeo/psalm/issues/15002), [@&#8203;orklah](https://github.com/orklah)) - Offsets of `DOMNamedNodeMap`, `Dom\NamedNodeMap`, `Dom\NodeList` and `Dom\HTMLCollection` are read by position or name instead of reporting `InvalidArrayAccess`. ([#&#8203;14535](https://github.com/vimeo/psalm/issues/14535), [@&#8203;jirkace](https://github.com/jirkace)) ##### Properties and constructors - `$object::$prop` is checked as a static fetch on the object's class, so undeclared and instance-only properties report `UndefinedPropertyFetch`. ([#&#8203;12046](https://github.com/vimeo/psalm/issues/12046), [@&#8203;HenkPoley](https://github.com/HenkPoley)) - No false `MissingConstructor` for a subclass inheriting the real constructor of a class a stub declares without one, and no `PropertyNotSetInConstructor` after `Ancestor::__construct()`. ([#&#8203;15001](https://github.com/vimeo/psalm/issues/15001), [@&#8203;orklah](https://github.com/orklah)) - `@psalm-suppress UndefinedConstant` applies to constants in docblock types (`@var int-mask<NO_SUCH_CONSTANT>`). ([#&#8203;13540](https://github.com/vimeo/psalm/issues/13540), [@&#8203;alies-dev](https://github.com/alies-dev)) ##### Purity - The `DateTime` and `DateTimeImmutable` constructors require only the `time` capability, and the `DateInterval` constructor is pure. ([#&#8203;14962](https://github.com/vimeo/psalm/issues/14962), [@&#8203;jirkace](https://github.com/jirkace)) ##### Stubs - Global constants added in PHP 8.5 (`CURLFOLLOW_ALL`, `ETH_P_ALL`, `PHP_BUILD_DATE`, …) are declared. ([#&#8203;13019](https://github.com/vimeo/psalm/issues/13019), [@&#8203;alies-dev](https://github.com/alies-dev)) - `DateInterval::createFromDateString()` no longer returns `false` on PHP 8.3+. ([#&#8203;11849](https://github.com/vimeo/psalm/issues/11849), [@&#8203;xelaris](https://github.com/xelaris)) - `SQLite3Result::columnName()` can return `false`. ([#&#8203;11819](https://github.com/vimeo/psalm/issues/11819), [@&#8203;stof](https://github.com/stof)) - `ReflectionObject` is generic, like `ReflectionClass`. ([#&#8203;11774](https://github.com/vimeo/psalm/issues/11774), [@&#8203;Kenny1911](https://github.com/Kenny1911)) - The property map covers ext-mongodb 2.3. ([#&#8203;11838](https://github.com/vimeo/psalm/issues/11838), [@&#8203;alcaeus](https://github.com/alcaeus)) ##### Language server and `--alter` - The language server keeps the types and references of a file without class methods when it analyses another file, so hover and go-to-definition keep working there. ([#&#8203;15003](https://github.com/vimeo/psalm/issues/15003), [@&#8203;danog](https://github.com/danog)) - `--alter` writes only native types the analysed PHP version supports (no `object` below 7.2) and writes `int|string` for `array-key` from PHP 8.0. ([#&#8203;14933](https://github.com/vimeo/psalm/issues/14933), [@&#8203;orklah](https://github.com/orklah)) #### Internal changes - Merge 6.x into master. ([#&#8203;14980](https://github.com/vimeo/psalm/issues/14980), [@&#8203;orklah](https://github.com/orklah)) - Perf corpus uses Drupal 11.4.14. ([#&#8203;14984](https://github.com/vimeo/psalm/issues/14984), [@&#8203;orklah](https://github.com/orklah)) #### New Contributors - [@&#8203;Kenny1911](https://github.com/Kenny1911) made their first contribution in [#&#8203;11774](https://github.com/vimeo/psalm/issues/11774) - [@&#8203;xelaris](https://github.com/xelaris) made their first contribution in [#&#8203;11849](https://github.com/vimeo/psalm/issues/11849) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.21.0...7.21.1> ### [`v7.21.0`](https://github.com/vimeo/psalm/releases/tag/7.21.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.20.0...7.21.0) #### Features - **Symfony HttpClient taints**: the body, headers, info and streamed chunks of its responses are input sources, and the URL of `HttpClientInterface::request()` is an SSRF sink. ([#&#8203;14950](https://github.com/vimeo/psalm/issues/14950), [@&#8203;danog](https://github.com/danog)) - `strtolower()` and `strtoupper()` of literal strings return literals: `strtoupper(rand(0, 1) ? "get" : "Post")` is `'GET'|'POST'`. ([#&#8203;14628](https://github.com/vimeo/psalm/issues/14628), [@&#8203;jirkace](https://github.com/jirkace)) #### Performance - Taint resolution links `Generator::send()` calls only through nodes a generator flows into: 17 s to 10 s for that step on a \~5,600-file codebase. ([#&#8203;13504](https://github.com/vimeo/psalm/issues/13504), [@&#8203;jarstelfox](https://github.com/jarstelfox)) - Taint resolution builds a flow's trace only for flows it reports: 28.9 s to 15.5 s on the same codebase. ([#&#8203;13539](https://github.com/vimeo/psalm/issues/13539), [@&#8203;jarstelfox](https://github.com/jarstelfox)) #### Fixes ##### Taint analysis - Unqualified builtin flags in a namespace (`ENT_QUOTES`, `JSON_HEX_TAG`) stay known when a library calls `define()` with a dynamic name, so the escaping they ask for is kept. ([#&#8203;14949](https://github.com/vimeo/psalm/issues/14949), [@&#8203;danog](https://github.com/danog)) ##### Assertions and narrowing - `@psalm-assert-if-true` and `@psalm-assert-if-false` of a remembered call apply when the call is compared with `true` or `false`. ([#&#8203;14605](https://github.com/vimeo/psalm/issues/14605), [@&#8203;jirkace](https://github.com/jirkace)) - A compound assignment in a condition (`($s .= "a") === "1a"`) narrows the variable it assigns. ([#&#8203;14532](https://github.com/vimeo/psalm/issues/14532), [@&#8203;jirkace](https://github.com/jirkace)) - Asserting a list on a non-empty array gives a non-empty list instead of a false `TypeDoesNotContainType`. ([#&#8203;14609](https://github.com/vimeo/psalm/issues/14609), [@&#8203;jirkace](https://github.com/jirkace)) - `isset()` on a sealed array with a template offset bounded by the array's keys is no longer an `InvalidArrayOffset`. ([#&#8203;14603](https://github.com/vimeo/psalm/issues/14603), [@&#8203;jirkace](https://github.com/jirkace)) ##### Types and templates - A `callable-object` no longer fits an object shape or a `callable-object` of another signature. ([#&#8203;14929](https://github.com/vimeo/psalm/issues/14929), [@&#8203;MikeFTV](https://github.com/MikeFTV)) - A value given to a template that `new` left unbound is checked against constraints naming other templates of the class (`IncompatibleTypeParameters`). ([#&#8203;12443](https://github.com/vimeo/psalm/issues/12443), [@&#8203;jarstelfox](https://github.com/jarstelfox)) #### Internal changes - Generated callmaps skip the methods of anonymous classes, which broke the stub image build. ([#&#8203;14952](https://github.com/vimeo/psalm/issues/14952), [@&#8203;danog](https://github.com/danog)) - Regression tests for [#&#8203;10172](https://github.com/vimeo/psalm/issues/10172), [#&#8203;10541](https://github.com/vimeo/psalm/issues/10541), [#&#8203;10818](https://github.com/vimeo/psalm/issues/10818) and [#&#8203;11482](https://github.com/vimeo/psalm/issues/11482). ([#&#8203;14523](https://github.com/vimeo/psalm/issues/14523), [@&#8203;jirkace](https://github.com/jirkace)) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.20.0...7.21.0> ### [`v7.20.0`](https://github.com/vimeo/psalm/releases/tag/7.20.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.19.0...7.20.0) #### Features - **`@psalm-overload`**: gives a function or method several signatures, and a call returns the result of the first one its arguments fit. ```php /** * @psalm-overload (LimitedQuery $query): PagedResult * @psalm-overload (UnlimitedQuery $query): PlainResult */ function search(Query $query): Result { /* ... */ } search(new LimitedQuery())->getPageCount(); // no issue search(new LimitedQuery())->getAllRecords(); // UndefinedMethod: PagedResult::getAllRecords ``` See [`@psalm-overload`](https://github.com/vimeo/psalm/blob/7.20.0/docs/annotating_code/supported_annotations.md#psalm-overload). Constructors are not supported yet. ([#&#8203;13353](https://github.com/vimeo/psalm/issues/13353), [#&#8203;13354](https://github.com/vimeo/psalm/issues/13354), [@&#8203;jirkace](https://github.com/jirkace)) - **Database taints**: - `@psalm-database-query ... readonly` marks a method that can only run reading queries, so its queries Psalm can't parse store nothing. See [the annotation](https://github.com/vimeo/psalm/blob/7.20.0/docs/security_analysis/annotations.md). ([#&#8203;14860](https://github.com/vimeo/psalm/issues/14860), [@&#8203;danog](https://github.com/danog)) - Rows inserted as a list store their values in their own columns. ([#&#8203;14853](https://github.com/vimeo/psalm/issues/14853), [@&#8203;danog](https://github.com/danog)) - ClickHouse: values bound to `{name}` and `{name:Type}` query parameters are stored, clauses after the tables of a `SELECT` are parsed, `INSERT ... FORMAT` stores its data in the listed columns, and `ALTER TABLE ... UPDATE` stores like `UPDATE`. ([#&#8203;14854](https://github.com/vimeo/psalm/issues/14854), [#&#8203;14859](https://github.com/vimeo/psalm/issues/14859), [#&#8203;14857](https://github.com/vimeo/psalm/issues/14857), [@&#8203;danog](https://github.com/danog)) - The SQL of `sprintf()` with a literal format is parsed, and a query in a variable (`$sql . " LIMIT 1"`) starts with what the analysis knows of `$sql`. ([#&#8203;14858](https://github.com/vimeo/psalm/issues/14858), [#&#8203;14856](https://github.com/vimeo/psalm/issues/14856), [@&#8203;danog](https://github.com/danog)) - phpClickHouse stub: what its queries store and read. ([#&#8203;14861](https://github.com/vimeo/psalm/issues/14861), [@&#8203;danog](https://github.com/danog)) - **Taint analysis**: - A `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. ([#&#8203;14171](https://github.com/vimeo/psalm/issues/14171), [@&#8203;danog](https://github.com/danog)) - A value put in an XPath string literal is reported only if it can hold a quote. ([#&#8203;14174](https://github.com/vimeo/psalm/issues/14174), [@&#8203;danog](https://github.com/danog)) - **Plugin API**: `Codebase::addTaintedCall()` adds calls that PHP code doesn't make (a Twig template calling a filter) to the taint graph, and `AddCallTaintsInterface` and `RemoveCallTaintsInterface` handlers run for these calls, which have no `Expr`. ([#&#8203;13658](https://github.com/vimeo/psalm/issues/13658), [@&#8203;danog](https://github.com/danog)) #### Fixes ##### Taint analysis - Decoders (`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. ([#&#8203;13642](https://github.com/vimeo/psalm/issues/13642), [@&#8203;danog](https://github.com/danog)) ##### Types - A `non-falsy-string` passed as a `callable-string` reports `ArgumentTypeCoercion`. ([#&#8203;14925](https://github.com/vimeo/psalm/issues/14925), [@&#8203;orklah](https://github.com/orklah)) - No false `UnsafeGenericInstantiation` for `new static` when `static` is only an array shape key in the return type. ([#&#8203;14920](https://github.com/vimeo/psalm/issues/14920), [@&#8203;orklah](https://github.com/orklah)) - A union keeps two conditional return types on the same template, different floats and different template class-strings apart instead of keeping only one. ([#&#8203;14919](https://github.com/vimeo/psalm/issues/14919), [@&#8203;orklah](https://github.com/orklah)) - `@psalm-assert iterable&Countable` keeps `Countable`, and intersections are compared by every part. ([#&#8203;14944](https://github.com/vimeo/psalm/issues/14944), [@&#8203;orklah](https://github.com/orklah)) - `$int & <non-negative int>` is bounded by the non-negative operand: `$i & 0x0F` is `int<0, 15>`. ([#&#8203;14507](https://github.com/vimeo/psalm/issues/14507), [@&#8203;jirkace](https://github.com/jirkace)) - A literal array is checked against `callable-array`. ([#&#8203;13424](https://github.com/vimeo/psalm/issues/13424), [@&#8203;jirkace](https://github.com/jirkace)) - `T&Stringable` casts to string when `T` is bounded by `object` or unbounded, and the cast charges `__toString()` in pure code. ([#&#8203;14471](https://github.com/vimeo/psalm/issues/14471), [@&#8203;jirkace](https://github.com/jirkace)) - A `class-string-map` combined into another array has its template replaced by its bound, and `class-string-map<T of Foo, T>` keeps its bound in a namespace. ([#&#8203;14934](https://github.com/vimeo/psalm/issues/14934), [@&#8203;orklah](https://github.com/orklah)) - An invalid array key message shows the whole key type (`list<int>`, not `array`). ([#&#8203;14923](https://github.com/vimeo/psalm/issues/14923), [@&#8203;orklah](https://github.com/orklah)) ##### Templates - A trait method implementing a method of a templated interface is compared with the class's `@implements` argument, without a false `MoreSpecificImplementedParamType`. ([#&#8203;14459](https://github.com/vimeo/psalm/issues/14459), [@&#8203;jirkace](https://github.com/jirkace)) - An argument with no part in a template's bound binds the parts of the bound it contains (`non-empty-string`, not `array|non-empty-string`). ([#&#8203;14582](https://github.com/vimeo/psalm/issues/14582), [@&#8203;jirkace](https://github.com/jirkace)) ##### Narrowing, loops and arrays - Reassigning `$x` after `$t = gettype($x)` unlinks `$t`, so `switch ($t)` no longer narrows the new `$x` to `never`. ([#&#8203;14937](https://github.com/vimeo/psalm/issues/14937), [@&#8203;orklah](https://github.com/orklah)) - `$x === $y` with `$y` one of several class-strings keeps all of them. ([#&#8203;14938](https://github.com/vimeo/psalm/issues/14938), [@&#8203;orklah](https://github.com/orklah)) - `!array_is_list()` of a value that is always a list reports `TypeDoesNotContainType`. ([#&#8203;14529](https://github.com/vimeo/psalm/issues/14529), [@&#8203;jirkace](https://github.com/jirkace)) - `isset($array[$id])` with a `string` `$id` on an array with int keys is not an `InvalidArrayOffset`. ([#&#8203;14652](https://github.com/vimeo/psalm/issues/14652), [@&#8203;jirkace](https://github.com/jirkace)) - A `for` or `while` loop whose counter starts beyond every value of an int bound (`for ($i = 1; $i <= $size; $i++)` with `$size: int<1, max>`) is always entered. ([#&#8203;14543](https://github.com/vimeo/psalm/issues/14543), [@&#8203;jirkace](https://github.com/jirkace)) - A `do`/`while` condition on an offset of a `mixed` variable no longer holds after the loop. ([#&#8203;14584](https://github.com/vimeo/psalm/issues/14584), [@&#8203;jirkace](https://github.com/jirkace)) - `??` accepts any left side (`null ?? 1`, a constant, an operation) without `InvalidArgument`, and drops its `null`. ([#&#8203;14591](https://github.com/vimeo/psalm/issues/14591), [@&#8203;jirkace](https://github.com/jirkace)) - With `rememberPropertyAssignmentsAfterCall="false"`, refinements of readonly properties survive calls. ([#&#8203;14571](https://github.com/vimeo/psalm/issues/14571), [@&#8203;jirkace](https://github.com/jirkace)) ##### Classes, properties and constants - A class constant with a native type, read through `static::` or an object of a non-final class, has that type instead of `mixed`. ([#&#8203;14596](https://github.com/vimeo/psalm/issues/14596), [@&#8203;jirkace](https://github.com/jirkace)) - `self` in the type of a trait property resolves against the class using it, `static` in an inherited property type against the class read, and `get_object_vars()` resolves template-bound literals. ([#&#8203;14512](https://github.com/vimeo/psalm/issues/14512), [@&#8203;jirkace](https://github.com/jirkace)) - A final class initialises properties through the trait methods it calls, without a false `PropertyNotSetInConstructor`. ([#&#8203;14566](https://github.com/vimeo/psalm/issues/14566), [@&#8203;jirkace](https://github.com/jirkace)) - The methods of a class declared inside another statement (`if (!class_exists(...))`, a function body) in a namespaced file are analysed. ([#&#8203;13654](https://github.com/vimeo/psalm/issues/13654), [@&#8203;danog](https://github.com/danog)) - Code that `autoload` also loads is no longer treated as unshipped because `autoload-dev` maps it too. ([#&#8203;14936](https://github.com/vimeo/psalm/issues/14936), [@&#8203;danog](https://github.com/danog)) ##### `--alter` - `properties-of<T>` is written as a native `array`. ([#&#8203;14930](https://github.com/vimeo/psalm/issues/14930), [@&#8203;lyn1dev](https://github.com/lyn1dev)) - Native types hold exactly the values of the type: a refined return type (`non-empty-string`) gets a docblock, and enums and anonymous class parents get the right namespace. ([#&#8203;14917](https://github.com/vimeo/psalm/issues/14917), [@&#8203;orklah](https://github.com/orklah)) - An intersection keeps its docblock when only some of its classes can be declared natively. ([#&#8203;14918](https://github.com/vimeo/psalm/issues/14918), [@&#8203;orklah](https://github.com/orklah)) - A string literal with a quote is escaped, and a union bound before `[]` or inside an intersection is parenthesised. ([#&#8203;14921](https://github.com/vimeo/psalm/issues/14921), [#&#8203;14935](https://github.com/vimeo/psalm/issues/14935), [@&#8203;orklah](https://github.com/orklah)) #### Internal changes - Each type writes its own id. `Atomic::getId()` no longer falls back to `getKey()`, so a plugin type that extends `Atomic` must write its id or it throws a `LogicException`. ([#&#8203;14922](https://github.com/vimeo/psalm/issues/14922), [@&#8203;orklah](https://github.com/orklah)) #### New Contributors - [@&#8203;lyn1dev](https://github.com/lyn1dev) made their first contribution in [#&#8203;14930](https://github.com/vimeo/psalm/issues/14930) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.19.0...7.20.0> ### [`v7.19.0`](https://github.com/vimeo/psalm/releases/tag/7.19.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.18.0...7.19.0) #### Features - `@phpstan-sealed` is read like `@psalm-inheritors`. ([#&#8203;11818](https://github.com/vimeo/psalm/issues/11818), [@&#8203;stof](https://github.com/stof)) - Psalm enables psalm/plugin-symfony when `composer.json` requires any Symfony package, not only `symfony/framework-bundle`. ([#&#8203;14682](https://github.com/vimeo/psalm/issues/14682), [@&#8203;danog](https://github.com/danog)) - `ensureOverrideAttribute` also reports `MissingOverrideAttribute` for a property (PHP 8.5), class constant or enum case (PHP 8.6) that overrides a parent member. ([#&#8203;14407](https://github.com/vimeo/psalm/issues/14407), [@&#8203;jirkace](https://github.com/jirkace)) - An `UndefinedPropertyFetch` or `UndefinedPropertyAssignment` on a property declared by `@property` in a class without `__get()`/`__set()` says to add the magic method or set `usePhpDocPropertiesWithoutMagicCall="true"`. ([#&#8203;14644](https://github.com/vimeo/psalm/issues/14644), [@&#8203;jirkace](https://github.com/jirkace)) - `@psalm-trace` works on static properties (`self::$name`). ([#&#8203;14629](https://github.com/vimeo/psalm/issues/14629), [@&#8203;jirkace](https://github.com/jirkace)) #### Fixes ##### Narrowing and conditions - Loose `==` keeps the values PHP juggles: `"1" == 1`, `1 == 1.0`, `false == []`, `$stringable == "a"`. ([#&#8203;14906](https://github.com/vimeo/psalm/issues/14906), [@&#8203;orklah](https://github.com/orklah)) - `== 0` keeps the `false` and `null` loosely equal to it, so `($h = fopen(...)) == 0` is no longer a `ParadoxicalCondition`. ([#&#8203;14823](https://github.com/vimeo/psalm/issues/14823), [@&#8203;orklah](https://github.com/orklah)) - `isset()` on an offset of a possibly-null `mixed` narrows in an `elseif` as in an `if`. ([#&#8203;14393](https://github.com/vimeo/psalm/issues/14393), [@&#8203;orklah](https://github.com/orklah)) - A contradiction on a variable that an earlier clause also mentions is reported. ([#&#8203;14828](https://github.com/vimeo/psalm/issues/14828), [@&#8203;orklah](https://github.com/orklah)) - `match (false)` narrows the variables of its conditions. ([#&#8203;14354](https://github.com/vimeo/psalm/issues/14354), [@&#8203;jirkace](https://github.com/jirkace)) - After an early return on `$item?->flag !== true`, `$item` is not null. ([#&#8203;14460](https://github.com/vimeo/psalm/issues/14460), [@&#8203;jirkace](https://github.com/jirkace)) - Narrowing an object to a subclass with `instanceof` keeps what is known of its properties. ([#&#8203;14537](https://github.com/vimeo/psalm/issues/14537), [@&#8203;jirkace](https://github.com/jirkace)) - `!array_key_exists($key, $array)` on a generic array says nothing about `$key`. ([#&#8203;14613](https://github.com/vimeo/psalm/issues/14613), [@&#8203;jirkace](https://github.com/jirkace)) - A `string` or `int` can be identical to `key-of<T>` or `value-of<T>` of a template `T of array`. ([#&#8203;14437](https://github.com/vimeo/psalm/issues/14437), [@&#8203;jirkace](https://github.com/jirkace)) - `instanceof UnitEnum` or `BackedEnum` excludes classes that aren't enums. ([#&#8203;14526](https://github.com/vimeo/psalm/issues/14526), [@&#8203;jirkace](https://github.com/jirkace)) - `($a['k'] ?? false) && ...` establishes that the key is set. ([#&#8203;14377](https://github.com/vimeo/psalm/issues/14377), [@&#8203;jirkace](https://github.com/jirkace)) - `isset()` and `??` on a magic property are not decided by the type of `__get()` (`SimpleXMLElement` children). ([#&#8203;14363](https://github.com/vimeo/psalm/issues/14363), [@&#8203;jirkace](https://github.com/jirkace)) - No false `ParadoxicalCondition` on a clause about a variable that a nested loop writes. ([#&#8203;14899](https://github.com/vimeo/psalm/issues/14899), [@&#8203;orklah](https://github.com/orklah)) - An `if` whose condition on an array offset always holds no longer makes the key optional. ([#&#8203;14896](https://github.com/vimeo/psalm/issues/14896), [@&#8203;orklah](https://github.com/orklah)) - With taint analysis on, an array narrowed by `isset()` in an `if` keeps the same type as without it. ([#&#8203;14893](https://github.com/vimeo/psalm/issues/14893), [@&#8203;orklah](https://github.com/orklah)) - Checking an extension and its functions, several functions of one extension, or functions of newer PHP versions is no longer a `RedundantCondition` or `TypeDoesNotContainType`. ([#&#8203;14822](https://github.com/vimeo/psalm/issues/14822), [@&#8203;orklah](https://github.com/orklah)) - `empty()` of a possibly undefined bool is not an `InvalidArgument`. ([#&#8203;14819](https://github.com/vimeo/psalm/issues/14819), [@&#8203;orklah](https://github.com/orklah)) - `MixedArrayAccess` is reported when a `!empty($p['a'])` check is stored in a variable first. ([#&#8203;14824](https://github.com/vimeo/psalm/issues/14824), [@&#8203;orklah](https://github.com/orklah)) - An exhaustive `switch (true)` over `instanceof` checks of final classes is not an `InvalidReturnType`. ([#&#8203;13362](https://github.com/vimeo/psalm/issues/13362), [@&#8203;jirkace](https://github.com/jirkace)) ##### Loops - A `while` or `for` loop whose condition holds on entry is always entered. ([#&#8203;14419](https://github.com/vimeo/psalm/issues/14419), [@&#8203;jirkace](https://github.com/jirkace)) - A variable assigned on the right of `&&` in a `for` condition is defined in the body and the step. ([#&#8203;14827](https://github.com/vimeo/psalm/issues/14827), [@&#8203;orklah](https://github.com/orklah)) - The temporary variable of a `switch` on a call doesn't stay in scope after it. ([#&#8203;14569](https://github.com/vimeo/psalm/issues/14569), [@&#8203;jirkace](https://github.com/jirkace)) ##### Arrays - A write under an unknown key or an append keeps the array shape. ([#&#8203;14642](https://github.com/vimeo/psalm/issues/14642), [@&#8203;jirkace](https://github.com/jirkace)) - A write under a non-literal key keeps the types of the offsets the key can't be. ([#&#8203;14825](https://github.com/vimeo/psalm/issues/14825), [@&#8203;orklah](https://github.com/orklah)) - `$array + ['key' => $default]` has the keys of the shape, and so does a shape plus an array. ([#&#8203;14621](https://github.com/vimeo/psalm/issues/14621), [@&#8203;jirkace](https://github.com/jirkace)) - An array created by a nested assignment with an offset (`$a[$k][$i] = $v`) is non-empty. ([#&#8203;14404](https://github.com/vimeo/psalm/issues/14404), [@&#8203;jirkace](https://github.com/jirkace)) - Destructurings PHP refuses to compile are reported, as are keys that a sealed shape doesn't have. ([#&#8203;14604](https://github.com/vimeo/psalm/issues/14604), [@&#8203;jirkace](https://github.com/jirkace)) - An invalid or mixed offset is reported once for `$a[$k]++`, `$a[$k] += 1` and by-reference arguments. ([#&#8203;14540](https://github.com/vimeo/psalm/issues/14540), [@&#8203;jirkace](https://github.com/jirkace)) - Destructuring or iterating into an item of an `ArrayAccess` object no longer checks a wrong value against `offsetSet()`. ([#&#8203;14371](https://github.com/vimeo/psalm/issues/14371), [@&#8203;jirkace](https://github.com/jirkace)) ##### Templates and generics - Values read by `foreach`, array fetches and destructuring from a generic construction resolve their type variables. ([#&#8203;14897](https://github.com/vimeo/psalm/issues/14897), [@&#8203;orklah](https://github.com/orklah)) - A conditional return type on a templated list keeps the template through a `non-empty-list` condition. ([#&#8203;14830](https://github.com/vimeo/psalm/issues/14830), [@&#8203;orklah](https://github.com/orklah)) - `false` records a bound on a type variable like `null` does. ([#&#8203;14589](https://github.com/vimeo/psalm/issues/14589), [@&#8203;jirkace](https://github.com/jirkace)) - An argument without a type binds the templates of its param to `mixed`. ([#&#8203;14592](https://github.com/vimeo/psalm/issues/14592), [@&#8203;jirkace](https://github.com/jirkace)) - An override without a docblock binds the templates of the param types it inherits. ([#&#8203;14394](https://github.com/vimeo/psalm/issues/14394), [@&#8203;jirkace](https://github.com/jirkace)) - `new` on a generic class keeps the template open when inherited public members can constrain it. ([#&#8203;14448](https://github.com/vimeo/psalm/issues/14448), [@&#8203;jirkace](https://github.com/jirkace)) - A template bound may name a template declared after it. ([#&#8203;14440](https://github.com/vimeo/psalm/issues/14440), [@&#8203;jirkace](https://github.com/jirkace)) - An inherited `@property` uses the template arguments of the parent. ([#&#8203;14530](https://github.com/vimeo/psalm/issues/14530), [@&#8203;jirkace](https://github.com/jirkace)) - A method returning `$this` with `@psalm-this-out` returns the `@psalm-this-out` type. ([#&#8203;14639](https://github.com/vimeo/psalm/issues/14639), [@&#8203;jirkace](https://github.com/jirkace)) - `class-string<T>` with `@template T as array|object` is not an `InvalidDocblock`. ([#&#8203;11755](https://github.com/vimeo/psalm/issues/11755), [@&#8203;vincent4vx](https://github.com/vincent4vx)) - An `array<mixed>` passed to an `iterable<string>` param is a `MixedArgumentTypeCoercion`, and conditional types such as `($iterable is list ? never : list<T>)` work again. ([#&#8203;13329](https://github.com/vimeo/psalm/issues/13329), [@&#8203;andrew-demb](https://github.com/andrew-demb)) - A `callable(never)` hint no longer turns a typed closure param into `never`. ([#&#8203;14447](https://github.com/vimeo/psalm/issues/14447), [@&#8203;jirkace](https://github.com/jirkace)) - `I&static` in a final class implementing `I` is that class. ([#&#8203;14461](https://github.com/vimeo/psalm/issues/14461), [@&#8203;jirkace](https://github.com/jirkace)) ##### Classes, methods and constants - A ternary or `match` whose every branch is `$this` is `$this`, and so is `tap($this, $callback)`. ([#&#8203;14818](https://github.com/vimeo/psalm/issues/14818), [#&#8203;14895](https://github.com/vimeo/psalm/issues/14895), [@&#8203;orklah](https://github.com/orklah)) - No false `PossiblyNullReference` after a call with arguments in a nested nullsafe chain. ([#&#8203;14850](https://github.com/vimeo/psalm/issues/14850), [@&#8203;alies-dev](https://github.com/alies-dev)) - A class using two traits with the same constant gets the first trait's, and method adaptations don't rename constants. ([#&#8203;14453](https://github.com/vimeo/psalm/issues/14453), [@&#8203;jirkace](https://github.com/jirkace)) - A class constant fetched on a union of classes is checked for each class. ([#&#8203;14593](https://github.com/vimeo/psalm/issues/14593), [@&#8203;jirkace](https://github.com/jirkace)) - No false `AmbiguousConstantInheritance` for a constant reached through a parent class and an interface. ([#&#8203;12663](https://github.com/vimeo/psalm/issues/12663), [@&#8203;Aerendir](https://github.com/Aerendir)) - No false `OverriddenPropertyAccess` when a subclass redeclares a protected property of a native extension class. ([#&#8203;12052](https://github.com/vimeo/psalm/issues/12052), [@&#8203;jturbide](https://github.com/jturbide)) - An override whose native param type is wider than the parent's keeps the extra types. ([#&#8203;14817](https://github.com/vimeo/psalm/issues/14817), [@&#8203;orklah](https://github.com/orklah)) - `PossiblyInvalidArgument` instead of `InvalidArgument` when a member of the argument's union is a parent type of the param. ([#&#8203;14820](https://github.com/vimeo/psalm/issues/14820), [@&#8203;orklah](https://github.com/orklah)) - Type aliases in inline docblocks resolve when the method is analysed again for a subclass in another file. ([#&#8203;14627](https://github.com/vimeo/psalm/issues/14627), [@&#8203;jirkace](https://github.com/jirkace)) - An `int-mask-of<self::A_*>` wildcard ignores constants that aren't integers. ([#&#8203;14348](https://github.com/vimeo/psalm/issues/14348), [@&#8203;jirkace](https://github.com/jirkace)) ##### Purity - A stubbed constructor with an empty body (`DateTimeImmutable`, `PDO`, `Redis`, …) is no longer treated as pure. ([#&#8203;14816](https://github.com/vimeo/psalm/issues/14816), [@&#8203;orklah](https://github.com/orklah)) - `strtr()` replacements, `array_multisort()` with string flags and unpacked `implode()` arguments charge `__toString()`. ([#&#8203;14451](https://github.com/vimeo/psalm/issues/14451), [@&#8203;jirkace](https://github.com/jirkace)) - `curl_share_setopt()`, `imap_timeout()` and `imap_expunge()` are impure. ([#&#8203;11858](https://github.com/vimeo/psalm/issues/11858), [@&#8203;ThomasLandauer](https://github.com/ThomasLandauer)) ##### Taint analysis - The `vprintf()` format and `curl_setopt()` options are read by param, also from named and unpacked arguments. ([#&#8203;14454](https://github.com/vimeo/psalm/issues/14454), [@&#8203;jirkace](https://github.com/jirkace)) - `extract()` of a sealed array is no `TaintedExtract`, and the variables it assigns carry the array's taint. ([#&#8203;14601](https://github.com/vimeo/psalm/issues/14601), [@&#8203;jirkace](https://github.com/jirkace)) ##### Stubs - `urlencode()` and `rawurlencode()` of a `non-empty-string` are non-empty. ([#&#8203;14521](https://github.com/vimeo/psalm/issues/14521), [@&#8203;jirkace](https://github.com/jirkace)) - `get_class()` combined with other strings is a `non-falsy-string`. ([#&#8203;14355](https://github.com/vimeo/psalm/issues/14355), [@&#8203;jirkace](https://github.com/jirkace)) - `Ds\Hashable::equals()` takes `$obj`. ([#&#8203;14373](https://github.com/vimeo/psalm/issues/14373), [@&#8203;jirkace](https://github.com/jirkace)) - The stub images build the bundled extensions (sockets, ldap, imap, …), so `MissingExtensionRequirement` is reported for them. ([#&#8203;14686](https://github.com/vimeo/psalm/issues/14686), [@&#8203;danog](https://github.com/danog)) ##### Messages - Issue messages print types with their literals and refinements (`RedundantCast`, `InvalidArrayOffset`, `InvalidIterator`, and any message that includes a union). ([#&#8203;14903](https://github.com/vimeo/psalm/issues/14903), [#&#8203;14905](https://github.com/vimeo/psalm/issues/14905), [@&#8203;orklah](https://github.com/orklah)) - `MixedMethodCall` names the known type of `object` and object shapes. ([#&#8203;14347](https://github.com/vimeo/psalm/issues/14347), [@&#8203;jirkace](https://github.com/jirkace)) ##### CLI, config and tools - Psalm no longer uses the autoloader of a parent directory in monorepos. ([#&#8203;11698](https://github.com/vimeo/psalm/issues/11698), [@&#8203;kkmuffme](https://github.com/kkmuffme)) - Shepherd reports to an endpoint that redirects no longer warn about HTTP 400. ([#&#8203;14849](https://github.com/vimeo/psalm/issues/14849), [@&#8203;alies-dev](https://github.com/alies-dev)) - An option that requires a value rejects an empty one (`--threads=`). ([#&#8203;14336](https://github.com/vimeo/psalm/issues/14336), [@&#8203;jirkace](https://github.com/jirkace)) - `psalm-refactor` rejects destinations PHP reserves as class or constant names. ([#&#8203;14617](https://github.com/vimeo/psalm/issues/14617), [@&#8203;jirkace](https://github.com/jirkace)) - `--alter` keeps string refinements (`non-empty-string`, `non-falsy-string`) in the docblocks it writes. ([#&#8203;14913](https://github.com/vimeo/psalm/issues/14913), [@&#8203;orklah](https://github.com/orklah)) ##### Plugin API - A `FunctionParamsProviderInterface` handler returning `[]` declares no params; return `null` to leave them unchanged. ([#&#8203;11622](https://github.com/vimeo/psalm/issues/11622), [@&#8203;kkmuffme](https://github.com/kkmuffme)) - `Union::getKey()` is deprecated and will be removed in Psalm 8: use `getId()` to identify a type. ([#&#8203;14910](https://github.com/vimeo/psalm/issues/14910), [@&#8203;orklah](https://github.com/orklah)) #### Internal changes - Merge 6.x into master, and backport of the `StreamSelectDriver` worker fork to 6.x. ([#&#8203;14839](https://github.com/vimeo/psalm/issues/14839), [@&#8203;orklah](https://github.com/orklah); [#&#8203;14750](https://github.com/vimeo/psalm/issues/14750), [@&#8203;zonuexe](https://github.com/zonuexe)) - Fix the unknown-key assignment tests broken by merging [#&#8203;14642](https://github.com/vimeo/psalm/issues/14642) and [#&#8203;14825](https://github.com/vimeo/psalm/issues/14825). ([#&#8203;14900](https://github.com/vimeo/psalm/issues/14900), [@&#8203;orklah](https://github.com/orklah)) - Document the text forms of a type. ([#&#8203;14916](https://github.com/vimeo/psalm/issues/14916), [@&#8203;orklah](https://github.com/orklah)) - Agents request a Bugbot review after every push. ([#&#8203;14847](https://github.com/vimeo/psalm/issues/14847), [@&#8203;danog](https://github.com/danog)) - Remove the baseline entry [#&#8203;11622](https://github.com/vimeo/psalm/issues/11622) made unused. ([#&#8203;14304](https://github.com/vimeo/psalm/issues/14304), [@&#8203;alies-dev](https://github.com/alies-dev)) #### New Contributors - [@&#8203;jturbide](https://github.com/jturbide) made their first contribution in [#&#8203;12052](https://github.com/vimeo/psalm/issues/12052) - [@&#8203;Aerendir](https://github.com/Aerendir) made their first contribution in [#&#8203;12663](https://github.com/vimeo/psalm/issues/12663) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.18.0...7.19.0> ### [`v7.18.0`](https://github.com/vimeo/psalm/releases/tag/7.18.0): Contravariant templates [Compare Source](https://github.com/vimeo/psalm/compare/7.17.0...7.18.0) #### 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. A `Sink<Animal>` fits where a `Sink<Dog>` is expected, not the other way round, and Psalm reports the template where the class gives a value out. ```php /** @template-contravariant T */ interface Sink { /** @param T $value */ public function put(mixed $value): void; /** @return T */ public function last(): mixed; // InvalidTemplateParam } /** @param Sink<Dog> $sink */ function takesDogSink(Sink $sink): void {} /** @param Sink<Animal> $animals */ function f(Sink $animals): void { takesDogSink($animals); // no issue } ``` Plugins read the variance with `ClassLikeStorage::getTemplateVariance()`. See [Template contravariance](https://github.com/vimeo/psalm/blob/7.18.0/docs/annotating_code/templated_annotations.md#template-contravariance); the templated annotations page was rewritten with checked examples. ([#&#8203;14669](https://github.com/vimeo/psalm/issues/14669), [@&#8203;alies-dev](https://github.com/alies-dev)) - **Performance profile**: `--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. ```bash vendor/bin/psalm --no-cache --profile=psalm-perf.json ``` See [Finding out why Psalm is slow](https://psalm.dev/docs/running_psalm/performance/). ([#&#8203;14737](https://github.com/vimeo/psalm/issues/14737), [#&#8203;14769](https://github.com/vimeo/psalm/issues/14769), [#&#8203;14807](https://github.com/vimeo/psalm/issues/14807), [@&#8203;alies-dev](https://github.com/alies-dev)) - **Agent skill for Psalm users**: `skills/psalm` teaches AI coding agents to run Psalm, fix its issues, write annotations and edit `psalm.xml` the way the docs recommend. Install it with `npx skills add vimeo/psalm --skill psalm`, with the [`llm/skills`](https://packagist.org/packages/llm/skills) Composer plugin, or by copying `vendor/vimeo/psalm/skills/psalm` into your agent's skills directory. ([#&#8203;13152](https://github.com/vimeo/psalm/issues/13152), [@&#8203;roxblnfk](https://github.com/roxblnfk); [#&#8203;14751](https://github.com/vimeo/psalm/issues/14751), [@&#8203;danog](https://github.com/danog); [#&#8203;14795](https://github.com/vimeo/psalm/issues/14795), [@&#8203;roxblnfk](https://github.com/roxblnfk)) #### Performance - Lower peak memory while resolving the taint graph. ([#&#8203;14774](https://github.com/vimeo/psalm/issues/14774), [@&#8203;aszenz](https://github.com/aszenz) [@&#8203;orklah](https://github.com/orklah)) #### Fixes ##### Templates and type variables - `new Pipe(fn (int $x) => ...)` with a `Closure(T): void` constructor param caps `T` at `int`, so a later `$pipe->push('s')` is `IncompatibleTypeParameters` instead of reaching the `int` callback. ([#&#8203;14669](https://github.com/vimeo/psalm/issues/14669), [@&#8203;alies-dev](https://github.com/alies-dev)) - A covariant template in the bound of a method template (`@template U of T`) is reported in a param even after an earlier param used `U` legally. ([#&#8203;14669](https://github.com/vimeo/psalm/issues/14669), [@&#8203;alies-dev](https://github.com/alies-dev)) - Callbacks over a widened type variable (`new Coll([1])`, then `$c->add('x')`) see every value it holds, not only the construction-site ones. ([#&#8203;14551](https://github.com/vimeo/psalm/issues/14551), [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca)) - `null` no longer fits a template without a bound: `fn() => null` for `callable(): T`, `[null]` for `list<T>`. ([#&#8203;14550](https://github.com/vimeo/psalm/issues/14550), [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca)) - Trait method params use the types given to `@use`. ([#&#8203;13429](https://github.com/vimeo/psalm/issues/13429), [@&#8203;jirkace](https://github.com/jirkace)) - `@implements Wrapper<static>` resolves `static` to the object it is read from, and chained calls on such a value no longer hang. ([#&#8203;14572](https://github.com/vimeo/psalm/issues/14572), [@&#8203;jirkace](https://github.com/jirkace)) - `@return static<NewK, NewV>` on a template receiver keeps its new type arguments. ([#&#8203;14579](https://github.com/vimeo/psalm/issues/14579), [@&#8203;jirkace](https://github.com/jirkace)) - An implementation with the same conditional return type as its interface method is not an `ImplementedReturnTypeMismatch`. ([#&#8203;14502](https://github.com/vimeo/psalm/issues/14502), [@&#8203;jirkace](https://github.com/jirkace)) - A conditional return type reads an argument that does not fit its param as it is (`preg_replace()` on an array of `Stringable` returns an array). ([#&#8203;14421](https://github.com/vimeo/psalm/issues/14421), [@&#8203;jirkace](https://github.com/jirkace)) - A template array `T` read at a `key-of<T>` offset is `value-of<T>`. ([#&#8203;14586](https://github.com/vimeo/psalm/issues/14586), [@&#8203;jirkace](https://github.com/jirkace)) - `is_int()`, `is_scalar()` and similar checks narrow a template bounded by `scalar`, `numeric`, `array-key` or an int range instead of reporting `DocblockTypeContradiction`. ([#&#8203;14545](https://github.com/vimeo/psalm/issues/14545), [@&#8203;jirkace](https://github.com/jirkace)) - A literal class name can be identical to a template `class-string<T>`. ([#&#8203;14365](https://github.com/vimeo/psalm/issues/14365), [@&#8203;jirkace](https://github.com/jirkace)) - Iterating a star-projected collection (`Coll<*>`) gives the template's bound instead of `mixed`. ([#&#8203;14666](https://github.com/vimeo/psalm/issues/14666), [@&#8203;alies-dev](https://github.com/alies-dev)) - Generated stubs keep `@template`, the variance and the declared order of templates instead of marking every template `@template-covariant`. ([#&#8203;14669](https://github.com/vimeo/psalm/issues/14669), [@&#8203;alies-dev](https://github.com/alies-dev)) ##### Narrowing and arrays - `$a !== $b` with several possible values of `$b` doesn't exclude them all from `$a`. ([#&#8203;14525](https://github.com/vimeo/psalm/issues/14525), [@&#8203;jirkace](https://github.com/jirkace)) - After `isset($array[$k])` with `$k` one of several literal keys, `$array[$k]` is the value of those keys. ([#&#8203;14646](https://github.com/vimeo/psalm/issues/14646), [@&#8203;jirkace](https://github.com/jirkace)) - `$arr[$key]` stays known to be set when `$key` is narrowed inside `if (isset($arr[$key]))`. ([#&#8203;13344](https://github.com/vimeo/psalm/issues/13344), [@&#8203;jirkace](https://github.com/jirkace)) - `InvalidArrayOffset` is reported when an item is read again under an index narrowed to a key the array can't have. ([#&#8203;14767](https://github.com/vimeo/psalm/issues/14767), [@&#8203;orklah](https://github.com/orklah)) - `($a ?? null) !== null` asserts `isset($a)`. ([#&#8203;14517](https://github.com/vimeo/psalm/issues/14517), [@&#8203;jirkace](https://github.com/jirkace)) - `instanceof` a parent class narrows to the parent class. ([#&#8203;14318](https://github.com/vimeo/psalm/issues/14318), [@&#8203;jirkace](https://github.com/jirkace)) - `get_class()` of a union of classes is the name of any of them. ([#&#8203;14366](https://github.com/vimeo/psalm/issues/14366), [@&#8203;jirkace](https://github.com/jirkace)) - A property of an object intersected with an object shape (`V&object{x: string}`) has the type of both. ([#&#8203;14546](https://github.com/vimeo/psalm/issues/14546), [@&#8203;jirkace](https://github.com/jirkace)) - With `ensureArray*OffsetsExist`, an offset that may be one of several literals is set only when each of them is. ([#&#8203;14606](https://github.com/vimeo/psalm/issues/14606), [@&#8203;jirkace](https://github.com/jirkace)) - Appends stop growing a list shape at `maxShapedArraySize`. ([#&#8203;14641](https://github.com/vimeo/psalm/issues/14641), [@&#8203;jirkace](https://github.com/jirkace)) - Quoted keys of an array shape are read as PHP string literals (`"a\r\nb"`). ([#&#8203;14600](https://github.com/vimeo/psalm/issues/14600), [@&#8203;jirkace](https://github.com/jirkace)) - No crash on PHP 8.5 for an array key that reads as a huge number, such as the UUID `'6e5212ed-…'` in Symfony's `Form` constraint. ([#&#8203;14797](https://github.com/vimeo/psalm/issues/14797), [@&#8203;leonardsimonse](https://github.com/leonardsimonse)) - `pow()` of two int literals is an int literal. ([#&#8203;14505](https://github.com/vimeo/psalm/issues/14505), [@&#8203;MikeFTV](https://github.com/MikeFTV)) ##### Control flow - A variable unset before a `continue` or `break` is possibly undefined after the loop. ([#&#8203;14509](https://github.com/vimeo/psalm/issues/14509), [@&#8203;jirkace](https://github.com/jirkace)) - A property or offset narrowed before a loop forgets the narrowing after a `break` that reassigned it. ([#&#8203;14456](https://github.com/vimeo/psalm/issues/14456), [@&#8203;jirkace](https://github.com/jirkace)) - Variables assigned in the left operand of a negated `&&` are defined in the next operands of the enclosing `&&`. ([#&#8203;14409](https://github.com/vimeo/psalm/issues/14409), [@&#8203;jirkace](https://github.com/jirkace)) - A superglobal assigned on some paths only keeps its default type on the others. ([#&#8203;14406](https://github.com/vimeo/psalm/issues/14406), [@&#8203;jirkace](https://github.com/jirkace)) - A closure that falls through after a `throw` or `exit` in a branch returns `void`, not `never`. ([#&#8203;14793](https://github.com/vimeo/psalm/issues/14793), [@&#8203;MikeFTV](https://github.com/MikeFTV)) - The return of a required file keeps the use of the outer `return`, so it is no `UnusedFunctionCall`. ([#&#8203;14562](https://github.com/vimeo/psalm/issues/14562), [@&#8203;jirkace](https://github.com/jirkace)) ##### Callables and nullsafe calls - Arguments of a call after a `?->` in a chain are analysed with a non-null receiver, as PHP skips the whole chain when it is null. ([#&#8203;14608](https://github.com/vimeo/psalm/issues/14608), [@&#8203;jirkace](https://github.com/jirkace)) - The if-true assertions of a method called with `?->` apply where the call is truthy. ([#&#8203;14531](https://github.com/vimeo/psalm/issues/14531), [@&#8203;jirkace](https://github.com/jirkace)) - An enum case with `__invoke()` is callable. ([#&#8203;14590](https://github.com/vimeo/psalm/issues/14590), [@&#8203;jirkace](https://github.com/jirkace)) - A first-class callable of a method that an unsealed class forwards to `__call()` is not an `UndefinedMagicMethod`. ([#&#8203;14411](https://github.com/vimeo/psalm/issues/14411), [@&#8203;jirkace](https://github.com/jirkace)) - `static` in closure hints of calls in a trait on other objects resolves to that object. ([#&#8203;14446](https://github.com/vimeo/psalm/issues/14446), [@&#8203;jirkace](https://github.com/jirkace)) - A `Closure` object of unknown signature is a `Closure`. ([#&#8203;14599](https://github.com/vimeo/psalm/issues/14599), [@&#8203;jirkace](https://github.com/jirkace)) - No crash on a callable array whose object intersects a template. ([#&#8203;14594](https://github.com/vimeo/psalm/issues/14594), [@&#8203;jirkace](https://github.com/jirkace)) - `yield from` forwards the send type of the inner generator. ([#&#8203;14340](https://github.com/vimeo/psalm/issues/14340), [@&#8203;jirkace](https://github.com/jirkace)) ##### Reported issues - A value that shares only `null` or `false` with the expected type is `InvalidArgument`, not `PossiblyInvalidArgument`, in closure params of `array_map()` and similar functions and in `__set()` calls on a `@property`. ([#&#8203;14742](https://github.com/vimeo/psalm/issues/14742), [@&#8203;orklah](https://github.com/orklah)) - `ParadoxicalCondition` on a dead `||` operand next to other values of the same variable. ([#&#8203;14821](https://github.com/vimeo/psalm/issues/14821), [@&#8203;orklah](https://github.com/orklah)) - No `ParamNameMismatch` for a name another overridden method uses. ([#&#8203;14536](https://github.com/vimeo/psalm/issues/14536), [@&#8203;jirkace](https://github.com/jirkace)) - No `MethodSignatureMismatch` for `@no-named-arguments` on parameterless methods. ([#&#8203;14799](https://github.com/vimeo/psalm/issues/14799), [@&#8203;orklah](https://github.com/orklah)) - A write through a `set` hook is checked against the hook's param type. ([#&#8203;14538](https://github.com/vimeo/psalm/issues/14538), [@&#8203;jirkace](https://github.com/jirkace)) - Properties that `array_column()` reads are used. ([#&#8203;14560](https://github.com/vimeo/psalm/issues/14560), [@&#8203;jirkace](https://github.com/jirkace)) - Before PHP 8.6, unsetting, passing by reference or referencing a property of a constant object is reported. ([#&#8203;14519](https://github.com/vimeo/psalm/issues/14519), [@&#8203;jirkace](https://github.com/jirkace)) - `@implements` naming an interface the class doesn't implement gets the same message with or without type arguments. ([#&#8203;14650](https://github.com/vimeo/psalm/issues/14650), [@&#8203;jirkace](https://github.com/jirkace)) - `@psalm-suppress` before the expression of `echo` or `<?=` is read. ([#&#8203;14527](https://github.com/vimeo/psalm/issues/14527), [@&#8203;jirkace](https://github.com/jirkace)) ##### Stubs - `ini_get()` of a core setting no longer includes `false`. ([#&#8203;14809](https://github.com/vimeo/psalm/issues/14809), [@&#8203;alies-dev](https://github.com/alies-dev)) - `intval()`, `floatval()` and `doubleval()` report what the casts report. ([#&#8203;14311](https://github.com/vimeo/psalm/issues/14311), [#&#8203;14805](https://github.com/vimeo/psalm/issues/14805), [@&#8203;jirkace](https://github.com/jirkace)) - `ArrayObject::offsetSet()` and `ArrayIterator::offsetSet()` accept a `null` offset. ([#&#8203;14516](https://github.com/vimeo/psalm/issues/14516), [@&#8203;jirkace](https://github.com/jirkace)) - `pgsql` extension stub with the `PGSQL_*` constants, and the classes of the `geos` extension. ([#&#8203;14637](https://github.com/vimeo/psalm/issues/14637), [#&#8203;14631](https://github.com/vimeo/psalm/issues/14631), [@&#8203;jirkace](https://github.com/jirkace)) - `FILTER_THROW_ON_FAILURE` is defined and has no failure value. ([#&#8203;14359](https://github.com/vimeo/psalm/issues/14359), [@&#8203;jirkace](https://github.com/jirkace)) - `Redis::auth()` and `RedisCluster::__construct()` accept phpredis ACL credentials. ([#&#8203;14800](https://github.com/vimeo/psalm/issues/14800), [@&#8203;orklah](https://github.com/orklah)) - SPL classes, `WeakMap`, `SoapClient`, `Memcached` and `PDOStatement` use the PHP 8 param names. ([#&#8203;14353](https://github.com/vimeo/psalm/issues/14353), [#&#8203;14367](https://github.com/vimeo/psalm/issues/14367), [@&#8203;jirkace](https://github.com/jirkace)) - The property map drops php-parser v4's `Name::$parts` and uses v5's `ArrayItem` for array and list items. ([#&#8203;14514](https://github.com/vimeo/psalm/issues/14514), [@&#8203;jirkace](https://github.com/jirkace)) ##### CLI, config and tools - `reportInfo="false"` also drops `Possibly*` issues that take `info` from their parent issue. ([#&#8203;14785](https://github.com/vimeo/psalm/issues/14785), [@&#8203;alies-dev](https://github.com/alies-dev)) - With an output format other than `console`, `phpstorm` and `github`, run statistics (`--stats`, the timing line, the `--profile` summary) go to stderr. ([#&#8203;14745](https://github.com/vimeo/psalm/issues/14745), [@&#8203;alies-dev](https://github.com/alies-dev)) - `--update-baseline` keeps multi-line samples of CRLF files. ([#&#8203;14794](https://github.com/vimeo/psalm/issues/14794), [@&#8203;ARAYN7011](https://github.com/ARAYN7011)) - The config schema allows naming the class or property in the handlers of `MissingDependency` and four other issues. ([#&#8203;14649](https://github.com/vimeo/psalm/issues/14649), [@&#8203;jirkace](https://github.com/jirkace)) - `--generate-stubs` keeps the trait uses and the interfaces of a class with a parent. ([#&#8203;14564](https://github.com/vimeo/psalm/issues/14564), [@&#8203;jirkace](https://github.com/jirkace)) - The class of `@psalm-scope-this` is scanned. ([#&#8203;14565](https://github.com/vimeo/psalm/issues/14565), [@&#8203;jirkace](https://github.com/jirkace)) - `psalm-refactor` rejects reserved words as destinations. ([#&#8203;14552](https://github.com/vimeo/psalm/issues/14552), [@&#8203;MohannadElemary](https://github.com/MohannadElemary)) - The language server ignores requests for documents that aren't files. ([#&#8203;14563](https://github.com/vimeo/psalm/issues/14563), [@&#8203;jirkace](https://github.com/jirkace)) #### Internal changes - Regression tests for fixed issues. ([#&#8203;14481](https://github.com/vimeo/psalm/issues/14481), [#&#8203;14474](https://github.com/vimeo/psalm/issues/14474), [#&#8203;14482](https://github.com/vimeo/psalm/issues/14482), [#&#8203;14436](https://github.com/vimeo/psalm/issues/14436), [#&#8203;14503](https://github.com/vimeo/psalm/issues/14503), [#&#8203;14520](https://github.com/vimeo/psalm/issues/14520), [#&#8203;14522](https://github.com/vimeo/psalm/issues/14522), [#&#8203;14524](https://github.com/vimeo/psalm/issues/14524), [#&#8203;14539](https://github.com/vimeo/psalm/issues/14539), [@&#8203;jirkace](https://github.com/jirkace); [#&#8203;14691](https://github.com/vimeo/psalm/issues/14691), [@&#8203;danog](https://github.com/danog)) - CI perf harness shows the files whose analysis got slower. ([#&#8203;14787](https://github.com/vimeo/psalm/issues/14787), [@&#8203;alies-dev](https://github.com/alies-dev)) - `PluginTest` works with psalm/plugin-phpunit 1.3.3. ([#&#8203;14810](https://github.com/vimeo/psalm/issues/14810), [@&#8203;orklah](https://github.com/orklah)) - Plugin API: `FunctionLikeAnalyzer::getFunctionLikeNode()` ([#&#8203;14635](https://github.com/vimeo/psalm/issues/14635)) and `Config::getPreloadedStubFiles()` ([#&#8203;14633](https://github.com/vimeo/psalm/issues/14633)), [@&#8203;jirkace](https://github.com/jirkace). Psalm now requires [psalm/psalm-plugin-api 0.5.2](https://github.com/psalm/psalm-plugin-api/releases/tag/0.5.2). ([#&#8203;14846](https://github.com/vimeo/psalm/issues/14846), [@&#8203;alies-dev](https://github.com/alies-dev)) #### New Contributors - [@&#8203;MikeFTV](https://github.com/MikeFTV) made their first contribution in [#&#8203;14505](https://github.com/vimeo/psalm/issues/14505) - [@&#8203;ARAYN7011](https://github.com/ARAYN7011) made their first contribution in [#&#8203;14794](https://github.com/vimeo/psalm/issues/14794) - [@&#8203;leonardsimonse](https://github.com/leonardsimonse) made their first contribution in [#&#8203;14797](https://github.com/vimeo/psalm/issues/14797) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.17.0...7.18.0> ### [`v7.17.0`](https://github.com/vimeo/psalm/releases/tag/7.17.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.16.0...7.17.0) <!-- Release notes generated using configuration in .github/release.yml at b5ea40db593f3acc7a4a20cc1a9bd338ce3bd405 --> #### What's Changed ##### Features - Report the functions and classes of extensions composer.json doesn't declare by [@&#8203;danog](https://github.com/danog) in [#&#8203;14234](https://github.com/vimeo/psalm/pull/14234) - Shepherd: Send baselined and info issue counts and analysis settings to [shepherd](https://shepherd.dev/) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14673](https://github.com/vimeo/psalm/pull/14673) - Shepherd: Write the Shepherd report to a file with --shepherd=file:// by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14729](https://github.com/vimeo/psalm/pull/14729) ##### Fixes - fix(class-string): get_parent_class() without an argument is bound to the parent class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14316](https://github.com/vimeo/psalm/pull/14316) - fix(property-map): ShellExec::$parts and MatchArm::$conds match php-parser v5 by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14341](https://github.com/vimeo/psalm/pull/14341) - fix(assertion): count() compared to a constant narrows like a literal by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14323](https://github.com/vimeo/psalm/pull/14323) - fix(cli): a missing root directory is shown as given when it is absolute by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14345](https://github.com/vimeo/psalm/pull/14345) - fix(foreach): the iterated expression is analysed once for getIterator() by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14370](https://github.com/vimeo/psalm/pull/14370) - fix(property): an offset write initializes an uninitialized array property by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14358](https://github.com/vimeo/psalm/pull/14358) - fix(docblock): [@&#8203;psalm-import-type](https://github.com/psalm-import-type) is read from any docblock before the class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14328](https://github.com/vimeo/psalm/pull/14328) - fix(unused-code): a method verified to return $this has no unused return value by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14337](https://github.com/vimeo/psalm/pull/14337) - fix(combiner): a non-empty array and a Traversable are not combined into iterable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14425](https://github.com/vimeo/psalm/pull/14425) - fix(stubs): ArrayObject and ArrayIterator use the PHP 8 parameter names by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14324](https://github.com/vimeo/psalm/pull/14324) - fix(arithmetic): int \*\* int may be a float when the exponent may be negative by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14317](https://github.com/vimeo/psalm/pull/14317) - fix(stubs): strtolower and mb_strtolower of string literals are the lowercased literals by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14321](https://github.com/vimeo/psalm/pull/14321) - fix(isset): keep the array value type when an ArrayAccess object is a union alternative by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13118](https://github.com/vimeo/psalm/pull/13118) - fix(templates): new of the class itself binds its templates from the arguments by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13425](https://github.com/vimeo/psalm/pull/13425) - fix(assertion): !== a bool literal of a template bounded by mixed is possible by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14362](https://github.com/vimeo/psalm/pull/14362) - fix(enum): report a circular reference of an enum case value instead of crashing by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14350](https://github.com/vimeo/psalm/pull/14350) - fix(switch): continue N targeting an outer switch leaves it like break N by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14368](https://github.com/vimeo/psalm/pull/14368) - fix(comparison): loose comparison of numeric string literals compares their numbers by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14369](https://github.com/vimeo/psalm/pull/14369) - fix(loop): a variable assigned in the right operand of || is defined after a while loop left through its condition by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14396](https://github.com/vimeo/psalm/pull/14396) - fix(baseline): a character XML 1.0 forbids in the selected text keeps the baseline loadable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14352](https://github.com/vimeo/psalm/pull/14352) - fix(arrays): a nested write under a key a list doesn't have creates the offset by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14434](https://github.com/vimeo/psalm/pull/14434) - fix(templates): a template of numeric can be identical to a string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14430](https://github.com/vimeo/psalm/pull/14430) - fix(override): #\[\Override] on a property without a parent property is an InvalidOverride by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14390](https://github.com/vimeo/psalm/pull/14390) - fix(algebra): a falsy variable holding a condition narrows to its negation by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14441](https://github.com/vimeo/psalm/pull/14441) - fix(class_exists): the code after an if chain knows the classes of every block that reaches it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14435](https://github.com/vimeo/psalm/pull/14435) - fix(constant): use const imports win over the PHP constant of the same name by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14325](https://github.com/vimeo/psalm/pull/14325) - fix(docblock): a param docblock of an implementation keeps the inherited return type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14360](https://github.com/vimeo/psalm/pull/14360) - fix(try): a variable assigned on some paths of a finally block keeps that type after the try by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14416](https://github.com/vimeo/psalm/pull/14416) - fix(list): a write under the key array_key_last() returned for a list keeps it a list by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14428](https://github.com/vimeo/psalm/pull/14428) - fix(templates): an int range bound to a constructor-only template stays open by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12944](https://github.com/vimeo/psalm/pull/12944) - Fix --generate-stubs signatures for intersections, true/never/static/parent, enums and readonly by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;14114](https://github.com/vimeo/psalm/pull/14114) - Fix assertions on $this of calls with no object, and make call-site InvalidDocblock suppressible by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14678](https://github.com/vimeo/psalm/pull/14678) - Expand the params of a final class's method with its static as the class itself by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;14203](https://github.com/vimeo/psalm/pull/14203) - Write through an ArrayAccess item of an array with its offsetSet() by [@&#8203;danog](https://github.com/danog) in [#&#8203;14422](https://github.com/vimeo/psalm/pull/14422) - Taint the items destructured from a mixed value or an ArrayAccess object by [@&#8203;danog](https://github.com/danog) in [#&#8203;14225](https://github.com/vimeo/psalm/pull/14225) - Report the extensions the PHP 8.6 stub image doesn't build yet by [@&#8203;danog](https://github.com/danog) in [#&#8203;14683](https://github.com/vimeo/psalm/pull/14683) - Check the extension of a symbol in every PHP version composer.json allows by [@&#8203;danog](https://github.com/danog) in [#&#8203;14685](https://github.com/vimeo/psalm/pull/14685) - Give a foreach over an IteratorAggregate the taints of what getIterator() returns by [@&#8203;danog](https://github.com/danog) in [#&#8203;14687](https://github.com/vimeo/psalm/pull/14687) - Keep the intersection of a template return type resolved to object by [@&#8203;danog](https://github.com/danog) in [#&#8203;14684](https://github.com/vimeo/psalm/pull/14684) - Report the sinks of PDO and other extensions composer.json doesn't require by [@&#8203;danog](https://github.com/danog) in [#&#8203;14688](https://github.com/vimeo/psalm/pull/14688) - Fix master CI by [@&#8203;danog](https://github.com/danog) in [#&#8203;14689](https://github.com/vimeo/psalm/pull/14689) - fix(reconciliation): is_callable() leaves out a template whose bound can't be callable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14622](https://github.com/vimeo/psalm/pull/14622) - fix(report): by-issue-level shows (always) and (feature) for errors without a numeric level by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14632](https://github.com/vimeo/psalm/pull/14632) - fix(arrays): a destructuring condition rules out the null a null value gives its variables by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14607](https://github.com/vimeo/psalm/pull/14607) - refactor(methods): remove the unreachable CallMap fallback of compareMethodSignatureParams() by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14612](https://github.com/vimeo/psalm/pull/14612) - fix(baseline): --update-baseline drops a duplicated code sample fixed once by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14561](https://github.com/vimeo/psalm/pull/14561) - fix(stubs): Ds\Vector and Ds\Deque declare the mutating methods of Sequence by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14645](https://github.com/vimeo/psalm/pull/14645) - fix(callables): match native callback functions case-insensitively by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14513](https://github.com/vimeo/psalm/pull/14513) - fix(stubs): array_product() of booleans is 0|1 by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14634](https://github.com/vimeo/psalm/pull/14634) - fix(reconciler): a string with a set offset is non-empty by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14638](https://github.com/vimeo/psalm/pull/14638) - fix(types): too many non-empty literal strings combine into a non-empty string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14640](https://github.com/vimeo/psalm/pull/14640) - fix(traits): report an alias or precedence rule for a method the traits don't have by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14626](https://github.com/vimeo/psalm/pull/14626) - fix(templates): a class-string-map is read and written with a literal Foo::class offset by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14616](https://github.com/vimeo/psalm/pull/14616) - fix(stubs): preg_grep() can return false by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14574](https://github.com/vimeo/psalm/pull/14574) - fix(reconciler): an object whose class is not a final class is not of it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14548](https://github.com/vimeo/psalm/pull/14548) - fix(new): report new of internal classes that can't be instantiated by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14570](https://github.com/vimeo/psalm/pull/14570) - fix(assertions): a bare post-increment or decrement condition narrows the variable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14534](https://github.com/vimeo/psalm/pull/14534) - fix(loops): a variable the condition always writes holds what the breaks or the condition leave by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14541](https://github.com/vimeo/psalm/pull/14541) - fix(foreach): a value variable bound by reference to the items of a property is limited to their type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14583](https://github.com/vimeo/psalm/pull/14583) - Follow taint through the builtin parameters PHP 8.0 renamed, when analysing for older versions by [@&#8203;danog](https://github.com/danog) in [#&#8203;14696](https://github.com/vimeo/psalm/pull/14696) - fix(properties): keep analysing after an invalid static property assignment by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14515](https://github.com/vimeo/psalm/pull/14515) - Fix: Shepherd reads local files for non-HTTP endpoints by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14728](https://github.com/vimeo/psalm/pull/14728) - Fix crash on a typeless [@&#8203;property](https://github.com/property), [@&#8203;global](https://github.com/global) or [@&#8203;param-out](https://github.com/param-out) tag with its name on the next line by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14704](https://github.com/vimeo/psalm/pull/14704) - Fix Psalter ignoring autoloader and extraFiles when given a single path by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14708](https://github.com/vimeo/psalm/pull/14708) - Share the value-vs-expected-type issue tree between arguments, returns and properties (experimental) by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14727](https://github.com/vimeo/psalm/pull/14727) - Resolve static in the assertions of static calls by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14721](https://github.com/vimeo/psalm/pull/14721) - Report PossiblyInvalidPropertyFetch for [@&#8203;property](https://github.com/property) and \_\_get() reads on unions with non-objects by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14706](https://github.com/vimeo/psalm/pull/14706) - Keep the extra key and value types of unsealed shapes in [@&#8203;method](https://github.com/method) and --alter by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14718](https://github.com/vimeo/psalm/pull/14718) - Narrow callable and iterable through their parts in is_countable() by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14712](https://github.com/vimeo/psalm/pull/14712) - Compare every entry of an array shape the same way by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14719](https://github.com/vimeo/psalm/pull/14719) - Suggest a trait method's purity annotation for every class using it by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14717](https://github.com/vimeo/psalm/pull/14717) - Share the property access checks of reads and writes by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14711](https://github.com/vimeo/psalm/pull/14711) - Share the CLI entry points' bootstrap and fix psalter/psalm-refactor drifts by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14705](https://github.com/vimeo/psalm/pull/14705) - Fix the sign and an overflow crash in int range multiplication by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14702](https://github.com/vimeo/psalm/pull/14702) - Keep useStrictTypes/ignoreTypeStats on symlinked project directories by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14698](https://github.com/vimeo/psalm/pull/14698) - Fall back to normal inference when a PhpStorm meta function override does not apply by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14701](https://github.com/vimeo/psalm/pull/14701) - fix(purity): eval() requires the impure capability by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14506](https://github.com/vimeo/psalm/pull/14506) - Show where the type of a Mixed\* issue comes from in the PhpStorm report by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14699](https://github.com/vimeo/psalm/pull/14699) - Share the steps instance and static method calls have in common (experimental) by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14703](https://github.com/vimeo/psalm/pull/14703) - fix(loops): for without a condition and while with a truthy literal are only left by a break by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14462](https://github.com/vimeo/psalm/pull/14462) - fix(docblock): two generic interfaces resolving to the same return type document the implementation by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14445](https://github.com/vimeo/psalm/pull/14445) - fix(reflection): take finality of reflected native classes and methods by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14508](https://github.com/vimeo/psalm/pull/14508) - fix(loops): a property read in a loop feeds the property assigned from it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14450](https://github.com/vimeo/psalm/pull/14450) ##### Internal changes - CI: assign pull request author as assignee by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14665](https://github.com/vimeo/psalm/pull/14665) - Share the left and right side copies of a few operand checks by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14695](https://github.com/vimeo/psalm/pull/14695) - Build the PHP 8.6 stub image, with grpc by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14694](https://github.com/vimeo/psalm/pull/14694) - Build the PHP 8.6 stub image by [@&#8203;danog](https://github.com/danog) in [#&#8203;14692](https://github.com/vimeo/psalm/pull/14692) - Factor the mixed-count guard into StatementsAnalyzer::shouldCountMixed() by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14700](https://github.com/vimeo/psalm/pull/14700) - Add job timeouts to the test workflows by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14732](https://github.com/vimeo/psalm/pull/14732) - Set the CI test time limit in the generated PHPUnit config by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14733](https://github.com/vimeo/psalm/pull/14733) - Fork every pool worker before Pool::run() submits a task by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14736](https://github.com/vimeo/psalm/pull/14736) - Merge CastAnalyzer::castIntAttempt and castFloatAttempt by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14720](https://github.com/vimeo/psalm/pull/14720) - Describe the argument-count deprecations of builtin functions in a table by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14697](https://github.com/vimeo/psalm/pull/14697) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.16.0...7.17.0> ### [`v7.16.0`](https://github.com/vimeo/psalm/releases/tag/7.16.0): Star projection [Compare Source](https://github.com/vimeo/psalm/compare/7.15.0...7.16.0) #### Features - **Star projection `Foo<*>`**: Kotlin's syntax for a generic argument you don't know. Reads go through the template's bound (`Box<*>::get()` is `object` for `T of object`), writes through it expect `never`, and `Box<*>` accepts any `Box`. See [Star projection](https://github.com/vimeo/psalm/blob/7.16.0/docs/annotating_code/templated_annotations.md#star-projection). ([#&#8203;13139](https://github.com/vimeo/psalm/issues/13139), [#&#8203;13493](https://github.com/vimeo/psalm/issues/13493), [#&#8203;14619](https://github.com/vimeo/psalm/issues/14619), [#&#8203;14598](https://github.com/vimeo/psalm/issues/14598), [@&#8203;alies-dev](https://github.com/alies-dev)) #### Performance - Scan workers send back only the stubs they added: −9 % wall, −14 % memory on a large Laravel app (8 threads, no cache). ([#&#8203;12558](https://github.com/vimeo/psalm/issues/12558), [@&#8203;alies-dev](https://github.com/alies-dev)) - Usage-inferred parameter types are recorded only for methods in the project directories: −8 to −15 % wall on apps that analyse their tests (one thread). ([#&#8203;13901](https://github.com/vimeo/psalm/issues/13901), [@&#8203;alies-dev](https://github.com/alies-dev)) - No exponential clause growth in `||` chains of `str_starts_with()`. Important for WordPress projects ([#&#8203;14653](https://github.com/vimeo/psalm/issues/14653), [@&#8203;alies-dev](https://github.com/alies-dev)) - Config loading skips directories a `**` entry already matched: 60 to 85 % faster with `**/vendor`-style entries. ([#&#8203;14624](https://github.com/vimeo/psalm/issues/14624), [@&#8203;alies-dev](https://github.com/alies-dev)) - A class docblock is split into lines once for all its `@method` tags: scanning up to 5 % faster on classes with hundreds of them, such as AWS SDK clients and Laravel Facades. ([#&#8203;14620](https://github.com/vimeo/psalm/issues/14620), [@&#8203;alies-dev](https://github.com/alies-dev)) #### Fixes ##### Templates - An inherited property or callable resolves the parent's template through what the child passes to it (`@extends Base<list<U>>`, `@extends Base<Box<TModel>>`, also across two `@extends` levels). ([#&#8203;14487](https://github.com/vimeo/psalm/issues/14487) [@&#8203;jirkace](https://github.com/jirkace), [#&#8203;14558](https://github.com/vimeo/psalm/issues/14558) [@&#8203;alies-dev](https://github.com/alies-dev)) - Callables of a non-generic child of a generic class bind the parent's template. ([#&#8203;14578](https://github.com/vimeo/psalm/issues/14578), [@&#8203;alies-dev](https://github.com/alies-dev)) - `new` on a `@template-covariant` class infers `never` for a template nothing can constrain, so `new Coll()` fits `Coll<int>`. ([#&#8203;14449](https://github.com/vimeo/psalm/issues/14449), [@&#8203;jirkace](https://github.com/jirkace)) ##### Callables and invokable objects - An intersection whose later member has `__invoke` is callable. ([#&#8203;14610](https://github.com/vimeo/psalm/issues/14610), [@&#8203;alies-dev](https://github.com/alies-dev)) - `array_map()` with an invokable object as the callback infers the return type of `__invoke` instead of `list<mixed>`. ([#&#8203;14654](https://github.com/vimeo/psalm/issues/14654), [@&#8203;alies-dev](https://github.com/alies-dev)) - An invokable object, a function name or an array passed where a `Closure` is expected is an `ArgumentTypeCoercion`, not an `InvalidArgument`. ([#&#8203;14657](https://github.com/vimeo/psalm/issues/14657), [@&#8203;alies-dev](https://github.com/alies-dev)) ##### Other - `--find-references-to` finds the calls of a function. ([#&#8203;14648](https://github.com/vimeo/psalm/issues/14648), [@&#8203;jirkace](https://github.com/jirkace)) - A crashing worker says which file it was processing. ([#&#8203;14651](https://github.com/vimeo/psalm/issues/14651), [@&#8203;jirkace](https://github.com/jirkace)) - A failing worker pool task (e.g. a plugin hook throwing in a scan worker) is reported once, not again as an unhandled future. ([#&#8203;14595](https://github.com/vimeo/psalm/issues/14595), [@&#8203;alies-dev](https://github.com/alies-dev)) #### Docs - Docs examples are self-contained and declare the config they need. ([#&#8203;14585](https://github.com/vimeo/psalm/issues/14585), [@&#8203;danog](https://github.com/danog)) #### Internal changes - CI: Shared duplicated code and dropped dead code. ([#&#8203;14553](https://github.com/vimeo/psalm/issues/14553), [@&#8203;orklah](https://github.com/orklah)) - CI: Perf bot: issues changed in place are shown as diffs, a regression warns at +10 % wall per project and +5 % in total, WordPress joins the corpus, and PRs that touch only tests or CI are skipped. ([#&#8203;14568](https://github.com/vimeo/psalm/issues/14568), [#&#8203;14575](https://github.com/vimeo/psalm/issues/14575), [#&#8203;14655](https://github.com/vimeo/psalm/issues/14655), [#&#8203;14656](https://github.com/vimeo/psalm/issues/14656), [@&#8203;alies-dev](https://github.com/alies-dev)) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.15.0...7.16.0> ### [`v7.15.0`](https://github.com/vimeo/psalm/releases/tag/7.15.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.14.0...7.15.0) <!-- Release notes generated using configuration in .github/release.yml at master --> #### What's Changed ##### Features - Give Closure::getCurrent() the signature of the closure it is called in by [@&#8203;danog](https://github.com/danog) in [#&#8203;14467](https://github.com/vimeo/psalm/pull/14467) - Report native constants newer than the analysed PHP version by [@&#8203;danog](https://github.com/danog) in [#&#8203;14478](https://github.com/vimeo/psalm/pull/14478) ##### Fixes - Date native symbols from a generated dictionary instead of loading every callmap by [@&#8203;danog](https://github.com/danog) in [#&#8203;14464](https://github.com/vimeo/psalm/pull/14464) - Charge io for the pgsql, pcntl and posix functions that use the server, the process or the system by [@&#8203;danog](https://github.com/danog) in [#&#8203;14465](https://github.com/vimeo/psalm/pull/14465) - Keep the callmap return type of a builtin whose stub declares none by [@&#8203;danog](https://github.com/danog) in [#&#8203;14466](https://github.com/vimeo/psalm/pull/14466) - Let a lazy ghost initializer call the constructor of the object it is given by [@&#8203;danog](https://github.com/danog) in [#&#8203;14470](https://github.com/vimeo/psalm/pull/14470) - Read C::{$name} like C::NAME when $name holds literal names by [@&#8203;danog](https://github.com/danog) in [#&#8203;14468](https://github.com/vimeo/psalm/pull/14468) - Don't crash on a static call of a native method newer than the runtime by [@&#8203;danog](https://github.com/danog) in [#&#8203;14479](https://github.com/vimeo/psalm/pull/14479) ##### Internal changes - Look up a file's directories in the unrequired package paths by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14533](https://github.com/vimeo/psalm/pull/14533) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.14.0...7.15.0> ### [`v7.14.0`](https://github.com/vimeo/psalm/releases/tag/7.14.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.13.2...7.14.0) <!-- Release notes generated using configuration in .github/release.yml at e63cd9fdec6eeddee714ef2f07a5d0308932db5e --> #### What's Changed ##### Features - Full PHP 8.6 support: deprecations, API types and capabilities by [@&#8203;danog](https://github.com/danog) in [#&#8203;14413](https://github.com/vimeo/psalm/pull/14413) - UX: List enabled plugins in the startup output by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14510](https://github.com/vimeo/psalm/pull/14510) ##### Fixes - Report an invalid psalm-refactor destination instead of crashing by [@&#8203;MohannadElemary](https://github.com/MohannadElemary) in [#&#8203;14097](https://github.com/vimeo/psalm/pull/14097) - fix: preserve array types after array_walk callbacks by [@&#8203;emreocell](https://github.com/emreocell) in [#&#8203;14173](https://github.com/vimeo/psalm/pull/14173) - Keep what both operands of xor assign in an if condition by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;14357](https://github.com/vimeo/psalm/pull/14357) - Resolve static nested in the hint of a typed closure param with the called class by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;14202](https://github.com/vimeo/psalm/pull/14202) - fix(templates): localize the return type of a closure in a used trait by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12810](https://github.com/vimeo/psalm/pull/12810) - fix(mixed): a non-empty mixed is never a falsy value, nor an empty mixed a truthy one by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12672](https://github.com/vimeo/psalm/pull/12672) - fix(stubs): DOMNode::$ownerDocument is nullable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14309](https://github.com/vimeo/psalm/pull/14309) - fix(args): unpacking an array shape with integer keys that is not a list passes as many arguments as it has keys by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14415](https://github.com/vimeo/psalm/pull/14415) - fix(reconciler): a loose comparison with a string keeps the scalars it can be equal to by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14429](https://github.com/vimeo/psalm/pull/14429) - fix(stubs): DateTimeImmutable::getTimezone() may return false by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14343](https://github.com/vimeo/psalm/pull/14343) - fix(stubs): pathinfo returns the array for PATHINFO_ALL by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14315](https://github.com/vimeo/psalm/pull/14315) - fix(combiner): a class-string key of a merged keyed array stays a class-string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14403](https://github.com/vimeo/psalm/pull/14403) - fix(property): a static property of static type in a final class takes the class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14351](https://github.com/vimeo/psalm/pull/14351) - fix(property-map): remove the bogus WriteException entry of the manual property map by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14344](https://github.com/vimeo/psalm/pull/14344) - fix(get_object_vars): resolve the class constants of a property type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14342](https://github.com/vimeo/psalm/pull/14342) - fix(arithmetic): % with a negative divisor takes the sign of the dividend by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14320](https://github.com/vimeo/psalm/pull/14320) - fix(method-comparator): implemented return type messages name the method as written by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14314](https://github.com/vimeo/psalm/pull/14314) - fix(call): call_user_func and call_user_func_array are matched case-insensitively by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14313](https://github.com/vimeo/psalm/pull/14313) - fix(docblock): an intersection type in an [@&#8203;method](https://github.com/method) parameter by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14338](https://github.com/vimeo/psalm/pull/14338) - fix(context): a variable first assigned in a possibly skipped branch keeps its type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14376](https://github.com/vimeo/psalm/pull/14376) - fix(deprecated): a promoted property marked [@&#8203;deprecated](https://github.com/deprecated) is reported on use by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14310](https://github.com/vimeo/psalm/pull/14310) - fix(loop): a foreach that is entered holds what an iteration ends with, at a continue too by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14418](https://github.com/vimeo/psalm/pull/14418) - fix(filter_var): bools, empty literals and FILTER_FLAG_EMPTY_STRING_NULL of FILTER_SANITIZE_STRING by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14329](https://github.com/vimeo/psalm/pull/14329) - fix(and): the left operand of && keeps the truthy clause of a nullable int by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14420](https://github.com/vimeo/psalm/pull/14420) - fix(stubs): declare Closure::getCurrent() for PHP 8.5 by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14339](https://github.com/vimeo/psalm/pull/14339) - fix(include): strict_types applies per file, not from the file that includes it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14402](https://github.com/vimeo/psalm/pull/14402) - Narrow ReflectionReference::fromArrayElement() for by-reference literal elements by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14488](https://github.com/vimeo/psalm/pull/14488) - Report GitHub Actions pull requests and other CI services to Shepherd by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14472](https://github.com/vimeo/psalm/pull/14472) - fix(visibility): a use adaptation changes the visibility a method call is checked with before \_\_call() by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14399](https://github.com/vimeo/psalm/pull/14399) - fix(isset): isset of an offset of a template array narrows the key to key-of by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14438](https://github.com/vimeo/psalm/pull/14438) - fix(php85): writing a property of a constant object is a compile error before PHP 8.6 by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14405](https://github.com/vimeo/psalm/pull/14405) - fix(mixin): an inaccessible property is read from the mixin through \_\_get() by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14375](https://github.com/vimeo/psalm/pull/14375) - fix(taint): a superglobal is still tainted after eval() by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14356](https://github.com/vimeo/psalm/pull/14356) - fix(array-access): a null offset of an ArrayAccess object is checked by offsetGet by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14349](https://github.com/vimeo/psalm/pull/14349) - Don't take matching another pattern for a paradox by [@&#8203;phcorp](https://github.com/phcorp) in [#&#8203;14444](https://github.com/vimeo/psalm/pull/14444) - Report an override that widens or drops the native type of a class constant by [@&#8203;danog](https://github.com/danog) in [#&#8203;14485](https://github.com/vimeo/psalm/pull/14485) ##### Docs - Document Shepherd on its own page by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14473](https://github.com/vimeo/psalm/pull/14473) ##### Internal changes - Fix the red filterVarSanitizeStringWithEmptyStringNull test on master by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14493](https://github.com/vimeo/psalm/pull/14493) - CI: Split BuildInfoCollector into one class per CI service by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14498](https://github.com/vimeo/psalm/pull/14498) #### New Contributors - [@&#8203;emreocell](https://github.com/emreocell) made their first contribution in [#&#8203;14173](https://github.com/vimeo/psalm/pull/14173) - [@&#8203;phcorp](https://github.com/phcorp) made their first contribution in [#&#8203;14444](https://github.com/vimeo/psalm/pull/14444) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.13.2...7.14.0> ### [`v7.13.2`](https://github.com/vimeo/psalm/releases/tag/7.13.2) [Compare Source](https://github.com/vimeo/psalm/compare/7.13.1...7.13.2) <!-- Release notes generated using configuration in .github/release.yml at 4a0667bf263efe571c414969b09b05a8db87c9f6 --> #### What's Changed ##### Fixes - Don't prefix PHP's Io namespace in the phar (crash on PHP 8.6 with threads) by [@&#8203;danog](https://github.com/danog) in [#&#8203;14414](https://github.com/vimeo/psalm/pull/14414) - Don't crash combining type variables that all stand for never until bound by [@&#8203;danog](https://github.com/danog) in [#&#8203;14379](https://github.com/vimeo/psalm/pull/14379) - Report only the ternary's own negated condition as redundant by [@&#8203;danog](https://github.com/danog) in [#&#8203;14417](https://github.com/vimeo/psalm/pull/14417) - Keep the template arguments of the object in callable($this) and callable(static) params by [@&#8203;danog](https://github.com/danog) in [#&#8203;14423](https://github.com/vimeo/psalm/pull/14423) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.13.1...7.13.2> ### [`v7.13.1`](https://github.com/vimeo/psalm/releases/tag/7.13.1) [Compare Source](https://github.com/vimeo/psalm/compare/7.13.0...7.13.1) <!-- Release notes generated using configuration in .github/release.yml at master --> #### What's Changed ##### Fixes - Fix template arguments of a parent named in another case, share @&#8203;extends/@&#8203;implements/[@&#8203;use](https://github.com/use) scanning by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14397](https://github.com/vimeo/psalm/pull/14397) - fix(assertion): a redundant negated assertion on a template keeps the template by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14330](https://github.com/vimeo/psalm/pull/14330) - Share the template and result code of negated type assertions by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14408](https://github.com/vimeo/psalm/pull/14408) - Count a write through an ArrayAccess offset as a use of the object by [@&#8203;danog](https://github.com/danog) in [#&#8203;14410](https://github.com/vimeo/psalm/pull/14410) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.13.0...7.13.1> ### [`v7.13.0`](https://github.com/vimeo/psalm/releases/tag/7.13.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.12.0...7.13.0) <!-- Release notes generated using configuration in .github/release.yml at master --> #### What's Changed ##### Features - Parse SQL queries to track security analysis taints by [@&#8203;danog](https://github.com/danog) in [#&#8203;14159](https://github.com/vimeo/psalm/pull/14159) - Add the redirect taint kind, and connect session stores to their reads by [@&#8203;danog](https://github.com/danog) in [#&#8203;14158](https://github.com/vimeo/psalm/pull/14158) - Give a parameter no sinks with [@&#8203;psalm-taint-sink](https://github.com/psalm-taint-sink) none by [@&#8203;danog](https://github.com/danog) in [#&#8203;14230](https://github.com/vimeo/psalm/pull/14230) - Trust the server a request reaches when the URL's host matches a list of hosts by [@&#8203;danog](https://github.com/danog) in [#&#8203;14170](https://github.com/vimeo/psalm/pull/14170) - Let plugins record what a validation checks, and trust the value once a check on its result says it passed by [@&#8203;danog](https://github.com/danog) in [#&#8203;14176](https://github.com/vimeo/psalm/pull/14176) - Report escaped values placed where their escaping doesn't protect them by [@&#8203;danog](https://github.com/danog) in [#&#8203;14400](https://github.com/vimeo/psalm/pull/14400) ##### Fixes - Let [@&#8203;psalm-](https://github.com/psalm-) purity tags win over [@&#8203;pure](https://github.com/pure) and [@&#8203;phpstan-pure](https://github.com/phpstan-pure) by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;14071](https://github.com/vimeo/psalm/pull/14071) - Pin type variables of new assigned to static properties, property items and property references by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14296](https://github.com/vimeo/psalm/pull/14296) - Keep references bound in a loop or branch after it by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14283](https://github.com/vimeo/psalm/pull/14283) - fix(reconciler): keep the value type of an array offset when empty() is true by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13087](https://github.com/vimeo/psalm/pull/13087) - Fix: default cache directory when HOME is unset or not writable by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14332](https://github.com/vimeo/psalm/pull/14332) - Fix: type of globals written through another function depends on file analysis order by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12549](https://github.com/vimeo/psalm/pull/12549) - Report a path the client chooses given to UploadedFileInterface::moveTo() and to the parameters inheriting a sink by [@&#8203;danog](https://github.com/danog) in [#&#8203;14227](https://github.com/vimeo/psalm/pull/14227) - fix(type): a callable is never falsy by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14322](https://github.com/vimeo/psalm/pull/14322) - fix(docblock): two interfaces documenting the same signature document the implementation by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14361](https://github.com/vimeo/psalm/pull/14361) - fix(assertions): a false $a !== $b gives both operands the type of the other by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13365](https://github.com/vimeo/psalm/pull/13365) - fix(call): the out type of a by-ref param reads the templates bound by later arguments by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13435](https://github.com/vimeo/psalm/pull/13435) - fix(docblock): callable param types with the same inner parameter name are not duplicated tags by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;14327](https://github.com/vimeo/psalm/pull/14327) - Infer loop variables reassigned from their own method call, property or offset by [@&#8203;danog](https://github.com/danog) in [#&#8203;14392](https://github.com/vimeo/psalm/pull/14392) - Keep the template of a variable identical to a literal by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14398](https://github.com/vimeo/psalm/pull/14398) ##### Docs - Turn the security analysis overview into a tutorial by [@&#8203;danog](https://github.com/danog) in [#&#8203;14228](https://github.com/vimeo/psalm/pull/14228) ##### Internal changes - Fix master self-analysis: mark cache-directory env vars as operator-chosen by [@&#8203;danog](https://github.com/danog) in [#&#8203;14378](https://github.com/vimeo/psalm/pull/14378) - Share the integer comparison narrowing of the two simple reconcilers by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14307](https://github.com/vimeo/psalm/pull/14307) - Merge the assertion finders of < and > comparisons by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14395](https://github.com/vimeo/psalm/pull/14395) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.12.0...7.13.0> </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/Berlin) - Branch creation - Between 12:00 AM and 05:59 AM, only on Monday (`* 0-5 * * 1`) - 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTcuOSIsInVwZGF0ZWRJblZlciI6IjQ0LjI1Ny45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJtaW5vciIsInBocCJdfQ==-->
chore(deps): update dependency vimeo/psalm to v7.22.0
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
regenerate-bot regenerating
CI / php (dev-master) (push) Has been cancelled
CI / php (dev-stable32) (push) Has been cancelled
CI / php (dev-stable33) (push) Has been cancelled
CI / php (dev-stable34) (push) Has been cancelled
CI / php (dev-stable35) (push) Has been cancelled
CI / standards (push) Has been cancelled
CI / server (32) (push) Has been cancelled
CI / server (35) (push) Has been cancelled
CI / javascript (push) Has been cancelled
CI / php (dev-master) (pull_request) Has been cancelled
CI / php (dev-stable32) (pull_request) Has been cancelled
CI / php (dev-stable33) (pull_request) Has been cancelled
CI / php (dev-stable34) (pull_request) Has been cancelled
CI / php (dev-stable35) (pull_request) Has been cancelled
CI / standards (pull_request) Has been cancelled
CI / server (32) (pull_request) Has been cancelled
CI / server (35) (pull_request) Has been cancelled
CI / javascript (pull_request) Has been cancelled
1818f9f8db
renovate-bot force-pushed renovate/all-minor-patch from 1818f9f8db
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
regenerate-bot regenerating
CI / php (dev-master) (push) Has been cancelled
CI / php (dev-stable32) (push) Has been cancelled
CI / php (dev-stable33) (push) Has been cancelled
CI / php (dev-stable34) (push) Has been cancelled
CI / php (dev-stable35) (push) Has been cancelled
CI / standards (push) Has been cancelled
CI / server (32) (push) Has been cancelled
CI / server (35) (push) Has been cancelled
CI / javascript (push) Has been cancelled
CI / php (dev-master) (pull_request) Has been cancelled
CI / php (dev-stable32) (pull_request) Has been cancelled
CI / php (dev-stable33) (pull_request) Has been cancelled
CI / php (dev-stable34) (pull_request) Has been cancelled
CI / php (dev-stable35) (pull_request) Has been cancelled
CI / standards (pull_request) Has been cancelled
CI / server (32) (pull_request) Has been cancelled
CI / server (35) (pull_request) Has been cancelled
CI / javascript (pull_request) Has been cancelled
to 2f7175e506
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI / server (35) (push) Successful in 2s
CI / server (32) (push) Successful in 2s
CI / server (32) (pull_request) Successful in 2s
CI / server (35) (pull_request) Successful in 2s
CI / javascript (push) Successful in 38s
CI / php (dev-master) (pull_request) Successful in 1m27s
CI / php (dev-stable35) (push) Successful in 1m29s
CI / php (dev-stable34) (pull_request) Successful in 1m24s
CI / php (dev-master) (push) Successful in 1m25s
CI / php (dev-stable33) (push) Successful in 1m26s
CI / php (dev-stable32) (push) Successful in 1m27s
CI / php (dev-stable34) (push) Successful in 1m28s
CI / standards (push) Successful in 1m31s
CI / php (dev-stable32) (pull_request) Successful in 1m29s
CI / php (dev-stable33) (pull_request) Successful in 1m25s
CI / php (dev-stable35) (pull_request) Successful in 1m25s
CI / standards (pull_request) Successful in 1m31s
CI / javascript (pull_request) Successful in 37s
regenerate-bot regenerated: chore(psalm): the baseline as the new Psalm records it
2026-11-30 03:44:52 +00:00
Compare
renovate-bot changed title from chore(deps): update dependency vimeo/psalm to v7.22.0 to chore(deps): update dependency vimeo/psalm to v7.22.1 2026-11-30 03:44:53 +00:00

Tests 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.

<!-- ci-report tests: CI-php-dev-master- --> ### Tests of CI / php (dev-master): passed **21 passed, 0 failed, 5 skipped** (26 tests, 0.1 s) <sub>Of d0c09c304c, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-stickers/actions/runs/138), updated by every run.</sub>

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.

<!-- ci-report tests: CI-php-dev-stable32- --> ### Tests of CI / php (dev-stable32): passed **21 passed, 0 failed, 5 skipped** (26 tests, 0.0 s) <sub>Of d0c09c304c, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-stickers/actions/runs/138), updated by every run.</sub>

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.

<!-- ci-report tests: CI-php-dev-stable33- --> ### Tests of CI / php (dev-stable33): passed **21 passed, 0 failed, 5 skipped** (26 tests, 0.1 s) <sub>Of d0c09c304c, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-stickers/actions/runs/138), updated by every run.</sub>

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.

<!-- ci-report tests: CI-php-dev-stable34- --> ### Tests of CI / php (dev-stable34): passed **21 passed, 0 failed, 5 skipped** (26 tests, 0.1 s) <sub>Of d0c09c304c, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-stickers/actions/runs/138), updated by every run.</sub>

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.

<!-- ci-report tests: CI-php-dev-stable35- --> ### Tests of CI / php (dev-stable35): passed **21 passed, 0 failed, 5 skipped** (26 tests, 0.1 s) <sub>Of d0c09c304c, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-stickers/actions/runs/138), updated by every run.</sub>
chore(psalm): the baseline as the new Psalm records it
All checks were successful
CI / php (dev-stable32) (push) Successful in 1m32s
CI / standards (push) Successful in 1m37s
CI / php (dev-master) (push) Successful in 1m34s
CI / php (dev-stable33) (push) Successful in 1m31s
CI / php (dev-stable34) (push) Successful in 1m34s
CI / server (32) (push) Successful in 1s
CI / server (35) (push) Successful in 2s
CI / php (dev-stable35) (push) Successful in 1m31s
CI / javascript (push) Successful in 43s
CI / php (dev-master) (pull_request) Successful in 1m25s
CI / php (dev-stable32) (pull_request) Successful in 1m23s
CI / php (dev-stable35) (pull_request) Successful in 1m23s
CI / server (35) (pull_request) Successful in 2m26s
CI / php (dev-stable33) (pull_request) Successful in 1m26s
CI / php (dev-stable34) (pull_request) Successful in 1m25s
CI / standards (pull_request) Successful in 1m31s
CI / javascript (pull_request) Successful in 41s
CI / server (32) (pull_request) Successful in 2m19s
d0c09c304c
dawid merged commit 6a38a57142 into main 2026-12-02 21:13:00 +00:00
dawid deleted branch renovate/all-minor-patch 2026-12-02 21:13:01 +00:00
Sign in to join this conversation.
No description provided.