fix(deps): update all non-major dependencies #20

Open
renovate-bot wants to merge 1 commit from renovate/all-minor-patch into main
Collaborator

This PR contains the following updates:

Package Type Update Change Pending Age Confidence
python (source) final minor 3.12-slim-bookworm → 3.13-slim-bookworm age confidence
vimeo/psalm require-dev minor 7.3.0 → 7.24.1 7.25.1 (+1) age confidence

Release Notes

vimeo/psalm

v7.24.1

Compare Source

What's Changed

Fixes
  • fix(types): an addition or subtraction with an unbounded side may overflow to a float by @​jirkace in #​15248
  • fix(array_map): infer the zip of arrays that aren't sealed shapes by @​shu-chen-dot-ca in #​15191
  • perf(language-server): read a message body at once instead of byte by byte by @​tm1000 in #​15242
  • fix(language-server): accept $/cancelRequest notifications by @​tm1000 in #​15394
  • Fix crash on a method call on a class implementing an undefined interface by @​orklah in #​15429
  • Say that the array is set after !empty() of an offset without an id by @​orklah in #​15432
  • Bind static to the class of a receiver that isn't late static by @​orklah in #​15431
  • Read an offset of an iterable from its array and its Traversable by @​orklah in #​15430
  • Remove Context::$fully_assigned_var_ids by @​orklah in #​15326
  • Fix: boolean-variable narrowing kept after reassignment in an elseif condition, a reference binding, or an && before || by @​alies-dev in #​12291
  • fix(reconciler): an optional object shape property may stay unset after an alternative of !isset by @​jirkace in #​15424
  • fix(assertions): get_class($o) !== $t of a template class-string narrows $o where it is false by @​jirkace in #​15408
  • fix(arrays): a write to an array shape in a union with an object updates the shape by @​jirkace in #​15436
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.24.0...7.24.1

v7.24.0

Compare Source

Features

  • Templates intersected with array shapes: T&array{id: int} is the type the template takes, with the keys of the shape added. A function can return what it was given plus new keys, and a param can require keys of a templated array. Psalm reported such an intersection as InvalidDocblock before. (#​15231, @​orklah)
    interface Users
    {
        /**
         * @template T of array
         * @param T $user
         * @return T&array{id: int}
         */
        public function save(array $user): array;
    }
    
    /**
     * @template T of array
     * @param T&array{id: int} $user
     */
    function userId(array $user): int
    {
        return $user['id'];
    }
    
    function register(Users $users): void
    {
        $user = $users->save(['name' => 'Ada']); // array{id: int, name: 'Ada'}
        echo userId($user);                      // no issue
        echo userId(['name' => 'Ada']);          // InvalidArgument
    }
    
    See Intersection types.
  • More PHPDoc type forms: Psalm reads these PHPStan forms instead of rejecting or misreading them. (#​15235, @​alies-dev)
    • * anywhere in a class constant mask (self::*_ACCESS), not only at the end.
      final class Access {
          public const READ_ACCESS = 1;
          public const WRITE_ACCESS = 2;
          public const DEBUG = 4;
      
          /** @param self::*_ACCESS $access */ // was InvalidDocblock
          public static function grant(int $access): void {}
      }
      
      Access::grant(Access::WRITE_ACCESS); // no issue
      Access::grant(Access::DEBUG);        // InvalidArgument: expects 1|2, but 4 provided
      
    • self:: and static:: in the @template bound of a method: self:: is the class the method is declared in (the using class for a trait method) and static:: the receiver's class. Psalm resolved both against the calling class, so $c->get(2) for @template B of self::REF_* was an InvalidArgument.
    • Shapes with ...<V> or ...<K, V> after their fields, and shapes without fields:
      Type Before After
      array{id: int, ...<string>} InvalidDocblock array{id: int, ...<array-key, string>}
      array{...} array<never, never> array<array-key, mixed>
      list{...<string>} array<never, never> list<string>
    • ? right after an operator: ?A&?B is A&B|null (was A|null), (A|?B)[] keeps B|null, and (T is ?int ? A : B) parses. ??int is an InvalidDocblock.
    • enum-string<HasLabel> accepts only enums: passing Plain::class of a class implementing HasLabel is an InvalidArgument.
    • int-mask-of<1|2|4> is 0|1|2|3|4|5|6|7, keywords work as shape keys (array{covariant: int}), and an extra type argument (key-of<array<int, string>, int>) is an InvalidDocblock instead of being dropped.
  • Methods named by known strings: Psalm resolves Foo::$m() and $foo->$m() when $m holds one or several known strings. The call returns what those methods return and is checked like a direct call. (#​15220, @​orklah)
    final class Report {
        public static function rows(): int { return 0; }
        public static function title(): string { return ""; }
    }
    
    function render(bool $short): void {
        $m = $short ? 'title' : 'rows';
        $r = Report::$m(); // int|string (was mixed)
    
        $n = 'footer';
        Report::$n();      // UndefinedMethod (was no issue)
    }
    
    A first-class callable on several classes, ($flag ? A::class : B::class)::make(...), is a closure of either method instead of only B::make().

Performance

  • A loop that passes a property to a call no longer takes an extra analysis pass. Nested loops multiplied that pass since 7.17.0: doctrine-orm's SqlWalker::walkSelectClause() analysed its inner loop 43 times instead of 23. (#​15365, @​orklah)
  • Property initialisation checks look for isset()-guarded properties only when the constructor returns early. (#​15327, @​orklah)

Fixes

Crashes
  • array_filter(), array_find() and their siblings called with only a named callback: argument no longer crash with Undefined array key 1. (#​15288, @​jirkace)
  • An argument that assigns null to the receiver of its method call ($h->foo($h = null)) no longer crashes Psalm. An argument that assigns a nullable value no longer narrows the receiver, so a later $h->get() is a PossiblyNullReference. (#​15367, @​jirkace)
  • A self-referencing class constant used as a template default (@template T of string = self::A with const A = self::A) is reported as CircularReference instead of crashing Psalm. (#​15321, @​jirkace)
Narrowing and reported issues
  • A call on a union of receivers (Foo|Bar) applies the @psalm-assert-if-true of one class's method only if the other class's method asserts it too. (#​15220, @​orklah)
  • After defined('ZipArchive::CREATE'), ZipArchive::CREATE is no MissingExtensionRequirement. (#​15315, @​jirkace)
  • ReferenceReusedFromConfusingScope is reported for a variable a loop detached from a reference, after it was released and bound again in another loop. (#​15331, @​orklah)

Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.23.0...7.24.0

v7.23.0

Compare Source

Features

  • Unions of sealed array shapes stay apart: Psalm keeps array{type: "card", last4: string}|array{type: "bank", iban: string} as two shapes instead of merging them into array{iban?: string, last4?: string, type: 'bank'|'card'}, so a check of one key tells which other keys are there. Comparing a tag, isset(), array_key_exists(), count() and switch pick the shape. (#​15156, @​jirkace)
    /** @param array{type: "card", last4: string}|array{type: "bank", iban: string} $method */
    function describe(array $method): string {
        if ($method["type"] === "card") {
            return "Card " . $method["last4"]; // no issue (was PossiblyUndefinedArrayOffset)
        }
        return "Bank " . $method["iban"];      // no issue (was PossiblyUndefinedArrayOffset)
    }
    
    /** @param array{type: "card", last4: string}|array{type: "bank", iban: string} $method */
    function wrong(array $method): string {
        if ($method["type"] === "card") {
            return $method["iban"];            // InvalidArrayOffset (was PossiblyUndefinedArrayOffset)
        }
        return "";
    }
    
    Unsealed shapes, unions of more than 8 shapes, and a shape union whose offset is written or unset are still merged into one shape.
  • in_array() narrows the array: checking for a single known value (null, true, false, a scalar literal or an enum case) narrows the haystack. (#​15152, @​rvyyv-n)
    enum Status { case Active; case Banned; }
    
    /** @param list<string|null> $names */
    function joinNames(array $names): string {
        if (in_array(null, $names, true)) {
            throw new InvalidArgumentException("A name is missing");
        }
        return implode(", ", $names); // $names: list<string> (was list<null|string>)
    }
    
    /** @param list<Status> $statuses */
    function check(array $statuses): void {
        if (!in_array(Status::Banned, $statuses, true)) {
            // $statuses: list<enum(Status::Active)> (was list<Status>)
        }
    }
    
    A loose in_array(null, $names) also rules out '', which is loosely equal to null: $names becomes list<non-empty-string>.
  • array_walk() and array_walk_recursive() callbacks are checked against the values, keys and extra argument the functions pass them. (#​15167, @​backendArchitect)
    /** @param array<string, int> $stock */
    function report(array $stock): void {
        array_walk($stock, static function (int $count, string $sku, string $prefix): void {
            echo $prefix . $sku . ": " . $count;
        }, "SKU ");                                                    // no issue
        array_walk($stock, static function (string $count): void {}); // InvalidScalarArgument: Parameter 1 of closure passed to function array_walk expects string, but int provided
        array_walk($stock, static function (int $count, int $sku): void {}); // InvalidScalarArgument: Parameter 2 … expects int, but string provided
        array_walk($stock, static function (int $count, string $sku, string $prefix): void {}, 5); // InvalidScalarArgument: Parameter 3 … expects string, but 5 provided
    }
    
  • @psalm-overload on constructors: new is checked like a method call. The overload the arguments fit binds the class templates, and arguments that fit no signature are reported against the last overload. The return type of an overload is not used. See @psalm-overload. (#​13355, @​jirkace)
    /** @template T */
    final class Box {
        /**
         * @psalm-overload (T $value)
         * @psalm-overload (T $value, int $count)
         */
        public function __construct(mixed $value, int $count = 1) {}
    }
    
    $box = new Box("apple"); // Box<'apple'> (was Box<mixed>)
    
    class Connection {
        /**
         * @psalm-overload (string $dsnOrHost)
         * @psalm-overload (string $dsnOrHost, int $port)
         */
        public function __construct(string $dsnOrHost, ?int $port = null) {}
    }
    
    new Connection("localhost", 3306); // no issue
    new Connection(3306);              // InvalidArgument, TooFewArguments (was InvalidScalarArgument)
    

Performance

  • A match with more arms than maxShapedArraySize no longer takes cubic time in the number of arms: 400 arms of an enum take 1.5 s instead of 30.5 s, and 753 arms 2.4 s instead of 184 s. (#​15161, @​jirkace)
  • Comparing two unions of many enum cases compares each case only with the case of the same key: 4096 cases take under 0.1 s instead of 15 s. (#​15162, @​jirkace)
  • Arithmetic on two large unions of int literals combines the results once: $a + $a on 250 literals takes under a second instead of 25 s. (#​15171, @​orklah)
  • Writing many literal offsets of one array skips comparing two different literal keys: a large application went from 36.5 s to 33.3 s. (#​15154, @​jirkace)

Fixes

Crashes
  • A callable param typed with key-of<TArr> of a template bounded by another template no longer crashes with count(): Argument #&#8203;1 ($value) must be of type Countable|array, null given when the template has no lower bound (an untyped closure param). (#​15212, @​jay23606)
Narrowing and reported issues
  • isset() and ?? on an array offset that always exists are reported as redundant: $a[0] ?? "" after $a = explode(",", $q) is a RedundantConditionGivenDocblockType. (#​12633, @​jirkace)
  • An is_*() or instanceof check of a literal or a call result that can never hold is reported like one of a variable (is_string(123) is a TypeDoesNotContainType), and is_float(1) is a TypeDoesNotContainType instead of a RedundantCondition. (#​15221, @​orklah)
  • === of two arrays that can both be empty (list<int> and list<string>), and instanceof of a non-final class on an object shape, are no false TypeDoesNotContainType, in a condition, a match arm or a bare statement. (#​15221, #​15229, @​orklah)
  • (bool) of true or false is a RedundantCast, and a branch on a stored condition that is always true or always false is analysed as unreachable. (#​15164, @​orklah)
  • $a !== $b against an object no longer narrows a wider iterable or callable $a with a false RedundantCondition. (#​14364, @​jirkace)
  • An interface, or a non-final class without __invoke(), may be callable: is_callable($handler) gives Handler&callable-object instead of a TypeDoesNotContainType. (#​14455, @​jirkace)
  • In !isList($x) || isMapInt($x), the negated array assertion keeps the non-array part of $x. (#​14427, @​jirkace)
  • A variable first assigned in a loop that may not run, or only before a break, keeps its possibly undefined type after the loop instead of mixed. (#​15181, @​orklah)
  • A [] that an unresolvable require may fill is no EmptyArrayAccess. (#​15189, @​jirkace)
Arrays
  • ??= on a key missing from a sealed shape creates it: $e["b"] ??= 2 gives array{a: 1, b: 2} instead of array{a: 1, b: 2|mixed} with a MixedAssignment, and the key that is never set is a TypeDoesNotContainType instead of an InvalidArrayOffset. (#​14573, @​jirkace)
  • After isset($l[$i]) with $i of 2|5, only the list items up to index 2 are required, so $l[4] is a PossiblyUndefinedArrayOffset. (#​15173, @​orklah)
  • A write under a non-literal key ($d[$k] = [1]) leaves the values of the other keys possibly empty, so empty($d[$j]) is no DocblockTypeContradiction. (#​15184, @​orklah)
  • An offset of an unsealed shape read after an isset() check of it is a PossiblyUndefinedArrayOffset. (#​15219, @​orklah)
  • A keyed destructuring into an offset or a property (["user" => $users[]] = $row) assigns it like =: the array gets the item, the property's type is checked, and taints flow to it. (#​14544, @​jirkace)
Types and templates
  • Return types computed from a union of literals use every literal, not only the first: pow(rand(0, 1) ? 2 : 3, 2) is 4|9 (was 4), and round(1.234, getInt()) is float (was float(1)). T[K] with a key of 'a'|'b', get_class($o) === $c with a union of class strings, and getAttributes() of a union of attribute classes use each of them. (#​15157, @​orklah)
  • A call of a callable array or a 'Class::method' string, directly or through call_user_func() and call_user_func_array(), returns what the method returns instead of mixed. (#​14511, @​jirkace)
  • A property read by one of several literal names ($o->{$p} with $p of 'x'|'y') has the type of each property instead of mixed. (#​14547, @​jirkace)
  • No false MixedArgumentTypeCoercion for an untyped closure param passed to a method of a receiver like static<int, TKey>, or for a method template bounded by a class template (TA of array<TKey, TValue>). (#​15183, @​orklah)
  • ArgumentTypeCoercion is reported again for an argument built in place (new Coll([new A()])) that breaks the bound of a method template, as for functions. (#​15214, @​orklah)
  • static in an intersection stays bound to its receiver: B<static>&static on a final class is B<F>&F, and a call on static&I no longer nests the receiver inside itself. (#​15215, @​orklah)
  • Animal::class is a PropertyTypeCoercion for a class-string<T> with T of Animal, since T may be a subclass. (#​14625, @​jirkace)
  • An intersection of a class and an object shape has the properties of both: Card&object{last4: string} fits object{brand: string, last4: string}. (#​14458, @​jirkace)
Docblocks
  • namespace\User in a docblock resolves to the current namespace, not a sub-namespace called namespace. (#​15177, @​alies-dev)
  • A callable param in @return named like a param of the function (Closure(int &$count): void on f(int $count)) is no longer read as that param: no InvalidDocblock, and & is kept. (#​15178, @​alies-dev)
  • An inline @var accepts a conditional on a param (($f is null ? T : int)), like @return. (#​14501, @​jirkace)
  • int-mask<> of a wildcard global constant (PHP_URL_*), a generic constant or an intersection of constants is an InvalidDocblock instead of a mask of 0 or of the first name. (#​15022, @​MikeFTV)
Classes, properties and traits
  • parent::class, parent::CONST and parent::$prop in a trait are those of the using class's parent instead of a ParentNotFound. (#​15015, @​jirkace)
  • A property keeps its own type where it is accessible, instead of the type of a @property of the same name that describes magic access. (#​15210, @​orklah)
  • A class declared under interface_exists() of a missing interface, and declared again in the else, is no UndefinedClass. (#​15199, @​orklah)
  • A trait method reaching members of a @psalm-internal class that uses it is no InternalClass or InternalMethod. (#​14374, @​jirkace)
  • @internal, @psalm-internal and #[Psalm\Internal] on a promoted constructor property report InternalProperty. (#​15013, @​jirkace)
Purity
  • Calling a closure, or a callable string or array, that may write properties forgets the memoized results of mutation-free methods, like an inline call: $clear(); return $owner->getChild(); is a NullableReturnStatement. (#​15046, @​shu-chen-dot-ca)
Taint analysis
  • MongoDB\BSON\ObjectId, UTCDateTime and the other BSON values the driver stores as their BSON type don't carry the nosql taint. Regex, Javascript, Document, PackedArray and userland BSON implementations keep it. (#​15099, @​danog)
  • A mixed variable narrowed by an if that otherwise leaves (if (!is_scalar($v)) return;) no longer gets back the taints the narrowing removed. (#​15163, @​danog)
  • strval(), implode() and vsprintf() of an object carry the taints of what its __toString() returns. (#​14452, @​jirkace)
  • An override keeps its own @psalm-taint-sink when the parent it inherits docblock types from has templates. (#​14504, @​jirkace)
Stubs and extensions
  • SoapClient::__setLocation() takes and returns ?string. (#​15010, @​jirkace)
  • MissingExtensionRequirement is not reported for an extension that a declared one requires (libxml for ext-dom, pdo for pdo_sqlite). (#​15182, @​orklah)
Messages
  • An issue on a docblock or attribute line selects the whole tag or attribute, not its indentation or a cut-off part. (#​15155, @​orklah)
  • PossiblyFalseArgument says possibly false value provided, like PossiblyNullArgument. (#​15151, @​ARAYN7011)
CLI and config
  • Without a php requirement in composer.json, Psalm analyses the version of its config.platform.php instead of the running PHP version. (#​15179, @​orklah)
  • A ** path pattern no longer follows a symlink cycle until it fails with Could not resolve config path. (#​14559, @​jirkace)
  • On Windows, each restarted Psalm process gets its own opcache, so a run no longer executes a plugin as another process cached it before it changed. (#​15234, @​alies-dev)
Plugin API
  • [BC] Union::isBool() is true when every member is a TBool, like isInt() and isString(): true and false alone are now bool. (#​15164, @​orklah)
  • Union::isSingle() is deprecated and will be removed in Psalm 8: it takes 1|2 for a single type, so getSingleAtomic() returns its first literal. Use isSingleAtomic() before getSingleAtomic(). (#​15157, @​orklah)
  • AfterMethodCallAnalysis gets the StaticCall the user wrote for a static call to a @mixin, or to an instance method through self::/static::, instead of a VirtualMethodCall. (#​15216, @​orklah)

Internal changes

  • Perf jobs run the base and head analyses side by side: the symfony and drupal jobs take about 4 min instead of 8. (#​15218, @​orklah)

New Contributors

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

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

v7.12.0

Compare Source

What's Changed

Features
  • Add @optional-arguments-by-name, @arguments-by-name and @stable-parameter-names by @​nicolas-grekas in #​12389
  • Make everything a PSR-7 message holds a taint source, and a method implementing or overriding a source one too by @​danog in #​14211
  • Define a variable assigned under a condition when the same condition is checked again by @​orklah in #​14222
  • feat(call): report a function called with a different casing than it is declared with by @​jirkace in #​13348
  • fix(types): remember the result of a pure function called with literals by @​jirkace in #​13422
  • Add a stub of the protobuf extension for Message, Timestamp and Duration by @​jirkace in #​12617
Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.11.0...7.12.0

v7.11.0

Compare Source

What's Changed

Features
  • Report the CWE weaknesses of issues, and use the issue type as the SARIF rule id by @​danog in #​14156
  • Remove the taints a value can't carry once it matches an anchored pattern, or a list of words through a string cast by @​danog in #​14161
  • Require the Doctrine plugin, and enable it when composer.json requires Doctrine by @​danog in #​14165
  • Report weak hashes and ciphers, seeded random number generators, insecure cookies and XXE by @​danog in #​14160
  • Make what symfony/yaml parses with PARSE_OBJECT an unserialize sink by @​danog in #​14172
Fixes
Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.10.0...7.11.0

v7.10.0

Compare Source

What's Changed

Features
Fixes
Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.9.0...7.10.0

v7.9.0

Compare Source

What's Changed

Features
Fixes
Internal changes
  • Re-enable skipped tests that pass, link the others to their issues by @​orklah in #​13935
  • Fix ComplexMethod on SwitchCaseAnalyzer::analyze() in self-analysis by @​orklah in #​13996

Full Changelog: https://github.com/vimeo/psalm/compare/7.8.0...7.9.0

v7.8.0

Compare Source

What's Changed

Features
Fixes
  • Don't add literals computed from what a loop changes by @​orklah in #​13902
  • Keep the narrowing of a boolean flag after a condition on the same array offset by @​orklah in #​13905
  • Fix false PossiblyUndefinedArrayOffset after a loop that breaks on isset() by @​orklah in #​13903
  • Run the taint handlers psalm registers in the invalid taint cases too by @​danog in #​13653
  • Don't report what die, exit and unpacked arguments of printf() and the like print from CLI code by @​danog in #​13652
  • Add the implicit null to the inferred type of closures falling off their end by @​orklah in #​13910
  • Fix false PossiblyUndefinedVariable after a loop for a variable assigned before every continue by @​orklah in #​13906

Full Changelog: https://github.com/vimeo/psalm/compare/7.7.0...7.8.0

v7.7.0

Compare Source

What's Changed

Features
Fixes
Internal changes
  • Perf: serialize storages without keeping their property tables (cold run of a big app: -18 % peak memory, -7 % wall) by @​alies-dev in #​13593

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.6.0...7.7.0

v7.6.0

Compare Source

What's Changed

Features
Fixes
Docs
Internal changes
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.5.0...7.6.0

v7.5.0

Compare Source

What's Changed

Features
Fixes
Internal changes
Other changes
  • feat(callable): report a callable that takes a parameter by reference where it is called with a value by @​jirkace in #​13548
  • fix(conditions): ignore what the left of an or tested of a variable the right reassigns by @​jirkace in #​13179

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.4.0...7.5.0

v7.4.0

Compare Source

What's Changed

Features
Fixes
  • Fix: initialize plugins before scanning the Composer autoload files in a full run by @​alies-dev in #​13591
Other changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.3.2...7.4.0

v7.3.2

Compare Source

What's Changed

Fixes
Internal changes
  • Perf: scan files from a warm cache without forking (big app warm run: -14 % wall, -15 % CPU, -13 % memory) by @​alies-dev in #​13251
Other changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.3.1...7.3.2

v7.3.1

Compare Source

What's Changed

Fixes
Internal changes
Other changes
  • fix(closure): keep what a closure writes to a by-reference variable before it returns by @​jirkace in #​13177
  • fix(mixin): forward a static call to the mixin that has the method by @​jirkace in #​13202

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.3.0...7.3.1


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.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • 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 | Type | Update | Change | Pending | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---|---|---|---| | [python](https://hub.docker.com/_/python) ([source](https://github.com/docker-library/python)) | final | minor | `3.12-slim-bookworm` → `3.13-slim-bookworm` | | ![age](https://developer.mend.io/api/mc/badges/age/docker/python/3.13?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/docker/python/3.12/3.13?slim=true) | | [vimeo/psalm](https://github.com/vimeo/psalm) | require-dev | minor | `7.3.0` → `7.24.1` | `7.25.1` (+1) | ![age](https://developer.mend.io/api/mc/badges/age/packagist/vimeo%2fpsalm/7.24.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/vimeo%2fpsalm/7.3.0/7.24.1?slim=true) | --- ### Release Notes <details> <summary>vimeo/psalm</summary> ### [`v7.24.1`](https://github.com/vimeo/psalm/releases/tag/7.24.1) [Compare Source](https://github.com/vimeo/psalm/compare/7.24.0...7.24.1) <!-- Release notes generated using configuration in .github/release.yml at a269933bc8bcd14d304a23c7ecb4a32efe8989c5 --> #### What's Changed ##### Fixes - fix(types): an addition or subtraction with an unbounded side may overflow to a float by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;15248](https://github.com/vimeo/psalm/pull/15248) - fix(array_map): infer the zip of arrays that aren't sealed shapes by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;15191](https://github.com/vimeo/psalm/pull/15191) - perf(language-server): read a message body at once instead of byte by byte by [@&#8203;tm1000](https://github.com/tm1000) in [#&#8203;15242](https://github.com/vimeo/psalm/pull/15242) - fix(language-server): accept $/cancelRequest notifications by [@&#8203;tm1000](https://github.com/tm1000) in [#&#8203;15394](https://github.com/vimeo/psalm/pull/15394) - Fix crash on a method call on a class implementing an undefined interface by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15429](https://github.com/vimeo/psalm/pull/15429) - Say that the array is set after !empty() of an offset without an id by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15432](https://github.com/vimeo/psalm/pull/15432) - Bind static to the class of a receiver that isn't late static by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15431](https://github.com/vimeo/psalm/pull/15431) - Read an offset of an iterable from its array and its Traversable by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15430](https://github.com/vimeo/psalm/pull/15430) - Remove Context::$fully_assigned_var_ids by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15326](https://github.com/vimeo/psalm/pull/15326) - Fix: boolean-variable narrowing kept after reassignment in an elseif condition, a reference binding, or an && before || by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12291](https://github.com/vimeo/psalm/pull/12291) - fix(reconciler): an optional object shape property may stay unset after an alternative of !isset by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;15424](https://github.com/vimeo/psalm/pull/15424) - fix(assertions): get_class($o) !== $t of a template class-string narrows $o where it is false by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;15408](https://github.com/vimeo/psalm/pull/15408) - fix(arrays): a write to an array shape in a union with an object updates the shape by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;15436](https://github.com/vimeo/psalm/pull/15436) ##### Internal changes - Keep the references an if/else rebinds in its IfScope by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15329](https://github.com/vimeo/psalm/pull/15329) - Require psalm/psalm-plugin-api 0.5.4 by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;15455](https://github.com/vimeo/psalm/pull/15455) - Tests: Check how a long match chain is analysed instead of timing it by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;15464](https://github.com/vimeo/psalm/pull/15464) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.24.0...7.24.1> ### [`v7.24.0`](https://github.com/vimeo/psalm/releases/tag/7.24.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.23.0...7.24.0) #### Features - **Templates intersected with array shapes**: `T&array{id: int}` is the type the template takes, with the keys of the shape added. A function can return what it was given plus new keys, and a param can require keys of a templated array. Psalm reported such an intersection as `InvalidDocblock` before. ([#&#8203;15231](https://github.com/vimeo/psalm/issues/15231), [@&#8203;orklah](https://github.com/orklah)) ```php interface Users { /** * @template T of array * @param T $user * @return T&array{id: int} */ public function save(array $user): array; } /** * @template T of array * @param T&array{id: int} $user */ function userId(array $user): int { return $user['id']; } function register(Users $users): void { $user = $users->save(['name' => 'Ada']); // array{id: int, name: 'Ada'} echo userId($user); // no issue echo userId(['name' => 'Ada']); // InvalidArgument } ``` See [Intersection types](https://github.com/vimeo/psalm/blob/7.24.0/docs/annotating_code/type_syntax/intersection_types.md). - **More PHPDoc type forms**: Psalm reads these PHPStan forms instead of rejecting or misreading them. ([#&#8203;15235](https://github.com/vimeo/psalm/issues/15235), [@&#8203;alies-dev](https://github.com/alies-dev)) - `*` anywhere in a class constant mask (`self::*_ACCESS`), not only at the end. ```php final class Access { public const READ_ACCESS = 1; public const WRITE_ACCESS = 2; public const DEBUG = 4; /** @param self::*_ACCESS $access */ // was InvalidDocblock public static function grant(int $access): void {} } Access::grant(Access::WRITE_ACCESS); // no issue Access::grant(Access::DEBUG); // InvalidArgument: expects 1|2, but 4 provided ``` - `self::` and `static::` in the `@template` bound of a method: `self::` is the class the method is declared in (the using class for a trait method) and `static::` the receiver's class. Psalm resolved both against the calling class, so `$c->get(2)` for `@template B of self::REF_*` was an `InvalidArgument`. - Shapes with `...<V>` or `...<K, V>` after their fields, and shapes without fields: | Type | Before | After | | ----------------------------- | --------------------- | ---------------------------------------- | | `array{id: int, ...<string>}` | `InvalidDocblock` | `array{id: int, ...<array-key, string>}` | | `array{...}` | `array<never, never>` | `array<array-key, mixed>` | | `list{...<string>}` | `array<never, never>` | `list<string>` | - `?` right after an operator: `?A&?B` is `A&B|null` (was `A|null`), `(A|?B)[]` keeps `B|null`, and `(T is ?int ? A : B)` parses. `??int` is an `InvalidDocblock`. - `enum-string<HasLabel>` accepts only enums: passing `Plain::class` of a class implementing `HasLabel` is an `InvalidArgument`. - `int-mask-of<1|2|4>` is `0|1|2|3|4|5|6|7`, keywords work as shape keys (`array{covariant: int}`), and an extra type argument (`key-of<array<int, string>, int>`) is an `InvalidDocblock` instead of being dropped. - **Methods named by known strings**: Psalm resolves `Foo::$m()` and `$foo->$m()` when `$m` holds one or several known strings. The call returns what those methods return and is checked like a direct call. ([#&#8203;15220](https://github.com/vimeo/psalm/issues/15220), [@&#8203;orklah](https://github.com/orklah)) ```php final class Report { public static function rows(): int { return 0; } public static function title(): string { return ""; } } function render(bool $short): void { $m = $short ? 'title' : 'rows'; $r = Report::$m(); // int|string (was mixed) $n = 'footer'; Report::$n(); // UndefinedMethod (was no issue) } ``` A first-class callable on several classes, `($flag ? A::class : B::class)::make(...)`, is a closure of either method instead of only `B::make()`. #### Performance - A loop that passes a property to a call no longer takes an extra analysis pass. Nested loops multiplied that pass since 7.17.0: doctrine-orm's `SqlWalker::walkSelectClause()` analysed its inner loop 43 times instead of 23. ([#&#8203;15365](https://github.com/vimeo/psalm/issues/15365), [@&#8203;orklah](https://github.com/orklah)) - Property initialisation checks look for `isset()`-guarded properties only when the constructor returns early. ([#&#8203;15327](https://github.com/vimeo/psalm/issues/15327), [@&#8203;orklah](https://github.com/orklah)) #### Fixes ##### Crashes - `array_filter()`, `array_find()` and their siblings called with only a named `callback:` argument no longer crash with `Undefined array key 1`. ([#&#8203;15288](https://github.com/vimeo/psalm/issues/15288), [@&#8203;jirkace](https://github.com/jirkace)) - An argument that assigns `null` to the receiver of its method call (`$h->foo($h = null)`) no longer crashes Psalm. An argument that assigns a nullable value no longer narrows the receiver, so a later `$h->get()` is a `PossiblyNullReference`. ([#&#8203;15367](https://github.com/vimeo/psalm/issues/15367), [@&#8203;jirkace](https://github.com/jirkace)) - A self-referencing class constant used as a template default (`@template T of string = self::A` with `const A = self::A`) is reported as `CircularReference` instead of crashing Psalm. ([#&#8203;15321](https://github.com/vimeo/psalm/issues/15321), [@&#8203;jirkace](https://github.com/jirkace)) ##### Narrowing and reported issues - A call on a union of receivers (`Foo|Bar`) applies the `@psalm-assert-if-true` of one class's method only if the other class's method asserts it too. ([#&#8203;15220](https://github.com/vimeo/psalm/issues/15220), [@&#8203;orklah](https://github.com/orklah)) - After `defined('ZipArchive::CREATE')`, `ZipArchive::CREATE` is no `MissingExtensionRequirement`. ([#&#8203;15315](https://github.com/vimeo/psalm/issues/15315), [@&#8203;jirkace](https://github.com/jirkace)) - `ReferenceReusedFromConfusingScope` is reported for a variable a loop detached from a reference, after it was released and bound again in another loop. ([#&#8203;15331](https://github.com/vimeo/psalm/issues/15331), [@&#8203;orklah](https://github.com/orklah)) #### Internal changes - Perf report: issue locations link to the line of the analysed project at the pinned commit, and memory has one decimal. The Symfony corpus moves to v8.2.0. ([#&#8203;15230](https://github.com/vimeo/psalm/issues/15230), [#&#8203;15337](https://github.com/vimeo/psalm/issues/15337), [@&#8203;orklah](https://github.com/orklah); [#&#8203;15388](https://github.com/vimeo/psalm/issues/15388), [@&#8203;alies-dev](https://github.com/alies-dev)) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.23.0...7.24.0> ### [`v7.23.0`](https://github.com/vimeo/psalm/releases/tag/7.23.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.22.1...7.23.0) #### Features - **Unions of sealed array shapes stay apart**: Psalm keeps `array{type: "card", last4: string}|array{type: "bank", iban: string}` as two shapes instead of merging them into `array{iban?: string, last4?: string, type: 'bank'|'card'}`, so a check of one key tells which other keys are there. Comparing a tag, `isset()`, `array_key_exists()`, `count()` and `switch` pick the shape. ([#&#8203;15156](https://github.com/vimeo/psalm/issues/15156), [@&#8203;jirkace](https://github.com/jirkace)) ```php /** @param array{type: "card", last4: string}|array{type: "bank", iban: string} $method */ function describe(array $method): string { if ($method["type"] === "card") { return "Card " . $method["last4"]; // no issue (was PossiblyUndefinedArrayOffset) } return "Bank " . $method["iban"]; // no issue (was PossiblyUndefinedArrayOffset) } /** @param array{type: "card", last4: string}|array{type: "bank", iban: string} $method */ function wrong(array $method): string { if ($method["type"] === "card") { return $method["iban"]; // InvalidArrayOffset (was PossiblyUndefinedArrayOffset) } return ""; } ``` Unsealed shapes, unions of more than 8 shapes, and a shape union whose offset is written or unset are still merged into one shape. - **`in_array()` narrows the array**: checking for a single known value (`null`, `true`, `false`, a scalar literal or an enum case) narrows the haystack. ([#&#8203;15152](https://github.com/vimeo/psalm/issues/15152), [@&#8203;rvyyv-n](https://github.com/rvyyv-n)) ```php enum Status { case Active; case Banned; } /** @param list<string|null> $names */ function joinNames(array $names): string { if (in_array(null, $names, true)) { throw new InvalidArgumentException("A name is missing"); } return implode(", ", $names); // $names: list<string> (was list<null|string>) } /** @param list<Status> $statuses */ function check(array $statuses): void { if (!in_array(Status::Banned, $statuses, true)) { // $statuses: list<enum(Status::Active)> (was list<Status>) } } ``` A loose `in_array(null, $names)` also rules out `''`, which is loosely equal to `null`: `$names` becomes `list<non-empty-string>`. - **`array_walk()` and `array_walk_recursive()` callbacks are checked** against the values, keys and extra argument the functions pass them. ([#&#8203;15167](https://github.com/vimeo/psalm/issues/15167), [@&#8203;backendArchitect](https://github.com/backendArchitect)) ```php /** @param array<string, int> $stock */ function report(array $stock): void { array_walk($stock, static function (int $count, string $sku, string $prefix): void { echo $prefix . $sku . ": " . $count; }, "SKU "); // no issue array_walk($stock, static function (string $count): void {}); // InvalidScalarArgument: Parameter 1 of closure passed to function array_walk expects string, but int provided array_walk($stock, static function (int $count, int $sku): void {}); // InvalidScalarArgument: Parameter 2 … expects int, but string provided array_walk($stock, static function (int $count, string $sku, string $prefix): void {}, 5); // InvalidScalarArgument: Parameter 3 … expects string, but 5 provided } ``` - **`@psalm-overload` on constructors**: `new` is checked like a method call. The overload the arguments fit binds the class templates, and arguments that fit no signature are reported against the last overload. The return type of an overload is not used. See [`@psalm-overload`](https://github.com/vimeo/psalm/blob/7.23.0/docs/annotating_code/supported_annotations.md#psalm-overload). ([#&#8203;13355](https://github.com/vimeo/psalm/issues/13355), [@&#8203;jirkace](https://github.com/jirkace)) ```php /** @template T */ final class Box { /** * @psalm-overload (T $value) * @psalm-overload (T $value, int $count) */ public function __construct(mixed $value, int $count = 1) {} } $box = new Box("apple"); // Box<'apple'> (was Box<mixed>) class Connection { /** * @psalm-overload (string $dsnOrHost) * @psalm-overload (string $dsnOrHost, int $port) */ public function __construct(string $dsnOrHost, ?int $port = null) {} } new Connection("localhost", 3306); // no issue new Connection(3306); // InvalidArgument, TooFewArguments (was InvalidScalarArgument) ``` #### Performance - A `match` with more arms than `maxShapedArraySize` no longer takes cubic time in the number of arms: 400 arms of an enum take 1.5 s instead of 30.5 s, and 753 arms 2.4 s instead of 184 s. ([#&#8203;15161](https://github.com/vimeo/psalm/issues/15161), [@&#8203;jirkace](https://github.com/jirkace)) - Comparing two unions of many enum cases compares each case only with the case of the same key: 4096 cases take under 0.1 s instead of 15 s. ([#&#8203;15162](https://github.com/vimeo/psalm/issues/15162), [@&#8203;jirkace](https://github.com/jirkace)) - Arithmetic on two large unions of int literals combines the results once: `$a + $a` on 250 literals takes under a second instead of 25 s. ([#&#8203;15171](https://github.com/vimeo/psalm/issues/15171), [@&#8203;orklah](https://github.com/orklah)) - Writing many literal offsets of one array skips comparing two different literal keys: a large application went from 36.5 s to 33.3 s. ([#&#8203;15154](https://github.com/vimeo/psalm/issues/15154), [@&#8203;jirkace](https://github.com/jirkace)) #### Fixes ##### Crashes - A callable param typed with `key-of<TArr>` of a template bounded by another template no longer crashes with `count(): Argument #&#8203;1 ($value) must be of type Countable|array, null given` when the template has no lower bound (an untyped closure param). ([#&#8203;15212](https://github.com/vimeo/psalm/issues/15212), [@&#8203;jay23606](https://github.com/jay23606)) ##### Narrowing and reported issues - `isset()` and `??` on an array offset that always exists are reported as redundant: `$a[0] ?? ""` after `$a = explode(",", $q)` is a `RedundantConditionGivenDocblockType`. ([#&#8203;12633](https://github.com/vimeo/psalm/issues/12633), [@&#8203;jirkace](https://github.com/jirkace)) - An `is_*()` or `instanceof` check of a literal or a call result that can never hold is reported like one of a variable (`is_string(123)` is a `TypeDoesNotContainType`), and `is_float(1)` is a `TypeDoesNotContainType` instead of a `RedundantCondition`. ([#&#8203;15221](https://github.com/vimeo/psalm/issues/15221), [@&#8203;orklah](https://github.com/orklah)) - `===` of two arrays that can both be empty (`list<int>` and `list<string>`), and `instanceof` of a non-final class on an object shape, are no false `TypeDoesNotContainType`, in a condition, a `match` arm or a bare statement. ([#&#8203;15221](https://github.com/vimeo/psalm/issues/15221), [#&#8203;15229](https://github.com/vimeo/psalm/issues/15229), [@&#8203;orklah](https://github.com/orklah)) - `(bool)` of `true` or `false` is a `RedundantCast`, and a branch on a stored condition that is always true or always false is analysed as unreachable. ([#&#8203;15164](https://github.com/vimeo/psalm/issues/15164), [@&#8203;orklah](https://github.com/orklah)) - `$a !== $b` against an object no longer narrows a wider `iterable` or `callable` `$a` with a false `RedundantCondition`. ([#&#8203;14364](https://github.com/vimeo/psalm/issues/14364), [@&#8203;jirkace](https://github.com/jirkace)) - An interface, or a non-final class without `__invoke()`, may be callable: `is_callable($handler)` gives `Handler&callable-object` instead of a `TypeDoesNotContainType`. ([#&#8203;14455](https://github.com/vimeo/psalm/issues/14455), [@&#8203;jirkace](https://github.com/jirkace)) - In `!isList($x) || isMapInt($x)`, the negated array assertion keeps the non-array part of `$x`. ([#&#8203;14427](https://github.com/vimeo/psalm/issues/14427), [@&#8203;jirkace](https://github.com/jirkace)) - A variable first assigned in a loop that may not run, or only before a `break`, keeps its possibly undefined type after the loop instead of `mixed`. ([#&#8203;15181](https://github.com/vimeo/psalm/issues/15181), [@&#8203;orklah](https://github.com/orklah)) - A `[]` that an unresolvable `require` may fill is no `EmptyArrayAccess`. ([#&#8203;15189](https://github.com/vimeo/psalm/issues/15189), [@&#8203;jirkace](https://github.com/jirkace)) ##### Arrays - `??=` on a key missing from a sealed shape creates it: `$e["b"] ??= 2` gives `array{a: 1, b: 2}` instead of `array{a: 1, b: 2|mixed}` with a `MixedAssignment`, and the key that is never set is a `TypeDoesNotContainType` instead of an `InvalidArrayOffset`. ([#&#8203;14573](https://github.com/vimeo/psalm/issues/14573), [@&#8203;jirkace](https://github.com/jirkace)) - After `isset($l[$i])` with `$i` of `2|5`, only the list items up to index 2 are required, so `$l[4]` is a `PossiblyUndefinedArrayOffset`. ([#&#8203;15173](https://github.com/vimeo/psalm/issues/15173), [@&#8203;orklah](https://github.com/orklah)) - A write under a non-literal key (`$d[$k] = [1]`) leaves the values of the other keys possibly empty, so `empty($d[$j])` is no `DocblockTypeContradiction`. ([#&#8203;15184](https://github.com/vimeo/psalm/issues/15184), [@&#8203;orklah](https://github.com/orklah)) - An offset of an unsealed shape read after an `isset()` check of it is a `PossiblyUndefinedArrayOffset`. ([#&#8203;15219](https://github.com/vimeo/psalm/issues/15219), [@&#8203;orklah](https://github.com/orklah)) - A keyed destructuring into an offset or a property (`["user" => $users[]] = $row`) assigns it like `=`: the array gets the item, the property's type is checked, and taints flow to it. ([#&#8203;14544](https://github.com/vimeo/psalm/issues/14544), [@&#8203;jirkace](https://github.com/jirkace)) ##### Types and templates - Return types computed from a union of literals use every literal, not only the first: `pow(rand(0, 1) ? 2 : 3, 2)` is `4|9` (was `4`), and `round(1.234, getInt())` is `float` (was `float(1)`). `T[K]` with a key of `'a'|'b'`, `get_class($o) === $c` with a union of class strings, and `getAttributes()` of a union of attribute classes use each of them. ([#&#8203;15157](https://github.com/vimeo/psalm/issues/15157), [@&#8203;orklah](https://github.com/orklah)) - A call of a callable array or a `'Class::method'` string, directly or through `call_user_func()` and `call_user_func_array()`, returns what the method returns instead of `mixed`. ([#&#8203;14511](https://github.com/vimeo/psalm/issues/14511), [@&#8203;jirkace](https://github.com/jirkace)) - A property read by one of several literal names (`$o->{$p}` with `$p` of `'x'|'y'`) has the type of each property instead of `mixed`. ([#&#8203;14547](https://github.com/vimeo/psalm/issues/14547), [@&#8203;jirkace](https://github.com/jirkace)) - No false `MixedArgumentTypeCoercion` for an untyped closure param passed to a method of a receiver like `static<int, TKey>`, or for a method template bounded by a class template (`TA of array<TKey, TValue>`). ([#&#8203;15183](https://github.com/vimeo/psalm/issues/15183), [@&#8203;orklah](https://github.com/orklah)) - `ArgumentTypeCoercion` is reported again for an argument built in place (`new Coll([new A()])`) that breaks the bound of a method template, as for functions. ([#&#8203;15214](https://github.com/vimeo/psalm/issues/15214), [@&#8203;orklah](https://github.com/orklah)) - `static` in an intersection stays bound to its receiver: `B<static>&static` on a final class is `B<F>&F`, and a call on `static&I` no longer nests the receiver inside itself. ([#&#8203;15215](https://github.com/vimeo/psalm/issues/15215), [@&#8203;orklah](https://github.com/orklah)) - `Animal::class` is a `PropertyTypeCoercion` for a `class-string<T>` with `T of Animal`, since `T` may be a subclass. ([#&#8203;14625](https://github.com/vimeo/psalm/issues/14625), [@&#8203;jirkace](https://github.com/jirkace)) - An intersection of a class and an object shape has the properties of both: `Card&object{last4: string}` fits `object{brand: string, last4: string}`. ([#&#8203;14458](https://github.com/vimeo/psalm/issues/14458), [@&#8203;jirkace](https://github.com/jirkace)) ##### Docblocks - `namespace\User` in a docblock resolves to the current namespace, not a sub-namespace called `namespace`. ([#&#8203;15177](https://github.com/vimeo/psalm/issues/15177), [@&#8203;alies-dev](https://github.com/alies-dev)) - A callable param in `@return` named like a param of the function (`Closure(int &$count): void` on `f(int $count)`) is no longer read as that param: no `InvalidDocblock`, and `&` is kept. ([#&#8203;15178](https://github.com/vimeo/psalm/issues/15178), [@&#8203;alies-dev](https://github.com/alies-dev)) - An inline `@var` accepts a conditional on a param (`($f is null ? T : int)`), like `@return`. ([#&#8203;14501](https://github.com/vimeo/psalm/issues/14501), [@&#8203;jirkace](https://github.com/jirkace)) - `int-mask<>` of a wildcard global constant (`PHP_URL_*`), a generic constant or an intersection of constants is an `InvalidDocblock` instead of a mask of `0` or of the first name. ([#&#8203;15022](https://github.com/vimeo/psalm/issues/15022), [@&#8203;MikeFTV](https://github.com/MikeFTV)) ##### Classes, properties and traits - `parent::class`, `parent::CONST` and `parent::$prop` in a trait are those of the using class's parent instead of a `ParentNotFound`. ([#&#8203;15015](https://github.com/vimeo/psalm/issues/15015), [@&#8203;jirkace](https://github.com/jirkace)) - A property keeps its own type where it is accessible, instead of the type of a `@property` of the same name that describes magic access. ([#&#8203;15210](https://github.com/vimeo/psalm/issues/15210), [@&#8203;orklah](https://github.com/orklah)) - A class declared under `interface_exists()` of a missing interface, and declared again in the `else`, is no `UndefinedClass`. ([#&#8203;15199](https://github.com/vimeo/psalm/issues/15199), [@&#8203;orklah](https://github.com/orklah)) - A trait method reaching members of a `@psalm-internal` class that uses it is no `InternalClass` or `InternalMethod`. ([#&#8203;14374](https://github.com/vimeo/psalm/issues/14374), [@&#8203;jirkace](https://github.com/jirkace)) - `@internal`, `@psalm-internal` and `#[Psalm\Internal]` on a promoted constructor property report `InternalProperty`. ([#&#8203;15013](https://github.com/vimeo/psalm/issues/15013), [@&#8203;jirkace](https://github.com/jirkace)) ##### Purity - Calling a closure, or a callable string or array, that may write properties forgets the memoized results of mutation-free methods, like an inline call: `$clear(); return $owner->getChild();` is a `NullableReturnStatement`. ([#&#8203;15046](https://github.com/vimeo/psalm/issues/15046), [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca)) ##### Taint analysis - `MongoDB\BSON\ObjectId`, `UTCDateTime` and the other BSON values the driver stores as their BSON type don't carry the `nosql` taint. `Regex`, `Javascript`, `Document`, `PackedArray` and userland BSON implementations keep it. ([#&#8203;15099](https://github.com/vimeo/psalm/issues/15099), [@&#8203;danog](https://github.com/danog)) - A `mixed` variable narrowed by an `if` that otherwise leaves (`if (!is_scalar($v)) return;`) no longer gets back the taints the narrowing removed. ([#&#8203;15163](https://github.com/vimeo/psalm/issues/15163), [@&#8203;danog](https://github.com/danog)) - `strval()`, `implode()` and `vsprintf()` of an object carry the taints of what its `__toString()` returns. ([#&#8203;14452](https://github.com/vimeo/psalm/issues/14452), [@&#8203;jirkace](https://github.com/jirkace)) - An override keeps its own `@psalm-taint-sink` when the parent it inherits docblock types from has templates. ([#&#8203;14504](https://github.com/vimeo/psalm/issues/14504), [@&#8203;jirkace](https://github.com/jirkace)) ##### Stubs and extensions - `SoapClient::__setLocation()` takes and returns `?string`. ([#&#8203;15010](https://github.com/vimeo/psalm/issues/15010), [@&#8203;jirkace](https://github.com/jirkace)) - `MissingExtensionRequirement` is not reported for an extension that a declared one requires (`libxml` for `ext-dom`, `pdo` for `pdo_sqlite`). ([#&#8203;15182](https://github.com/vimeo/psalm/issues/15182), [@&#8203;orklah](https://github.com/orklah)) ##### Messages - An issue on a docblock or attribute line selects the whole tag or attribute, not its indentation or a cut-off part. ([#&#8203;15155](https://github.com/vimeo/psalm/issues/15155), [@&#8203;orklah](https://github.com/orklah)) - `PossiblyFalseArgument` says `possibly false value provided`, like `PossiblyNullArgument`. ([#&#8203;15151](https://github.com/vimeo/psalm/issues/15151), [@&#8203;ARAYN7011](https://github.com/ARAYN7011)) ##### CLI and config - Without a `php` requirement in `composer.json`, Psalm analyses the version of its `config.platform.php` instead of the running PHP version. ([#&#8203;15179](https://github.com/vimeo/psalm/issues/15179), [@&#8203;orklah](https://github.com/orklah)) - A `**` path pattern no longer follows a symlink cycle until it fails with `Could not resolve config path`. ([#&#8203;14559](https://github.com/vimeo/psalm/issues/14559), [@&#8203;jirkace](https://github.com/jirkace)) - On Windows, each restarted Psalm process gets its own opcache, so a run no longer executes a plugin as another process cached it before it changed. ([#&#8203;15234](https://github.com/vimeo/psalm/issues/15234), [@&#8203;alies-dev](https://github.com/alies-dev)) ##### Plugin API - \[BC] `Union::isBool()` is true when every member is a `TBool`, like `isInt()` and `isString()`: `true` and `false` alone are now `bool`. ([#&#8203;15164](https://github.com/vimeo/psalm/issues/15164), [@&#8203;orklah](https://github.com/orklah)) - `Union::isSingle()` is deprecated and will be removed in Psalm 8: it takes `1|2` for a single type, so `getSingleAtomic()` returns its first literal. Use `isSingleAtomic()` before `getSingleAtomic()`. ([#&#8203;15157](https://github.com/vimeo/psalm/issues/15157), [@&#8203;orklah](https://github.com/orklah)) - `AfterMethodCallAnalysis` gets the `StaticCall` the user wrote for a static call to a `@mixin`, or to an instance method through `self::`/`static::`, instead of a `VirtualMethodCall`. ([#&#8203;15216](https://github.com/vimeo/psalm/issues/15216), [@&#8203;orklah](https://github.com/orklah)) #### Internal changes - Perf jobs run the base and head analyses side by side: the symfony and drupal jobs take about 4 min instead of 8. ([#&#8203;15218](https://github.com/vimeo/psalm/issues/15218), [@&#8203;orklah](https://github.com/orklah)) #### New Contributors - [@&#8203;rvyyv-n](https://github.com/rvyyv-n) made their first contribution in [#&#8203;15152](https://github.com/vimeo/psalm/issues/15152) - [@&#8203;backendArchitect](https://github.com/backendArchitect) made their first contribution in [#&#8203;15167](https://github.com/vimeo/psalm/issues/15167) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.22.1...7.23.0> ### [`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> ### [`v7.12.0`](https://github.com/vimeo/psalm/releases/tag/7.12.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.11.0...7.12.0) <!-- Release notes generated using configuration in .github/release.yml at 67cfa8476f9f2d666a5d3b54817738d1536afa77 --> #### What's Changed ##### Features - Add `@optional-arguments-by-name`, `@arguments-by-name` and `@stable-parameter-names` by [@&#8203;nicolas-grekas](https://github.com/nicolas-grekas) in [#&#8203;12389](https://github.com/vimeo/psalm/pull/12389) - Make everything a PSR-7 message holds a taint source, and a method implementing or overriding a source one too by [@&#8203;danog](https://github.com/danog) in [#&#8203;14211](https://github.com/vimeo/psalm/pull/14211) - Define a variable assigned under a condition when the same condition is checked again by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14222](https://github.com/vimeo/psalm/pull/14222) - feat(call): report a function called with a different casing than it is declared with by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13348](https://github.com/vimeo/psalm/pull/13348) - fix(types): remember the result of a pure function called with literals by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13422](https://github.com/vimeo/psalm/pull/13422) - Add a stub of the protobuf extension for Message, Timestamp and Duration by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12617](https://github.com/vimeo/psalm/pull/12617) ##### Fixes - Let loops see the writes made through references by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14193](https://github.com/vimeo/psalm/pull/14193) - Drop the clauses of variables a call writes through a closure or a global by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14195](https://github.com/vimeo/psalm/pull/14195) - Keep the arrays holding an item bound by reference in sync by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14194](https://github.com/vimeo/psalm/pull/14194) - Fix: crash on `sort()` and `array_unique()` when Psalm runs on PHP 8.6 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14201](https://github.com/vimeo/psalm/pull/14201) - Replace the invalid UTF-8 in the taint traces of a report too by [@&#8203;danog](https://github.com/danog) in [#&#8203;14212](https://github.com/vimeo/psalm/pull/14212) - Match named arguments by name where named arguments are not allowed by [@&#8203;danog](https://github.com/danog) in [#&#8203;14213](https://github.com/vimeo/psalm/pull/14213) - Analyse the condition of a ternary as the condition of an if by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14207](https://github.com/vimeo/psalm/pull/14207) - Forget the memoized results of the methods of an object when one of its properties is written by [@&#8203;danog](https://github.com/danog) in [#&#8203;14167](https://github.com/vimeo/psalm/pull/14167) - Report a sink of a variadic parameter once for an argument after its first by [@&#8203;danog](https://github.com/danog) in [#&#8203;13651](https://github.com/vimeo/psalm/pull/13651) - Narrow a value cast to a string and found in a list when none of its other types has a string form in it by [@&#8203;danog](https://github.com/danog) in [#&#8203;14169](https://github.com/vimeo/psalm/pull/14169) - Read a dynamic property as what the object holds under its name by [@&#8203;danog](https://github.com/danog) in [#&#8203;14177](https://github.com/vimeo/psalm/pull/14177) - Keep what was assigned to a dynamic property when it is read back by [@&#8203;danog](https://github.com/danog) in [#&#8203;14223](https://github.com/vimeo/psalm/pull/14223) - Store what is assigned to a dynamic property in the object, under its name by [@&#8203;danog](https://github.com/danog) in [#&#8203;14224](https://github.com/vimeo/psalm/pull/14224) - Fork workers with the StreamSelectDriver event loop by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14238](https://github.com/vimeo/psalm/pull/14238) - Report array access on objects not implementing ArrayAccess as InvalidArrayAccess by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14237](https://github.com/vimeo/psalm/pull/14237) - Forget stale narrowings after branches, offset writes and comparand changes by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14208](https://github.com/vimeo/psalm/pull/14208) - Keep inherited assertions on parent:: calls and in unused-call checks by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14280](https://github.com/vimeo/psalm/pull/14280) - Forget narrowings of variables a closure passed inside an array captures by reference by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14276](https://github.com/vimeo/psalm/pull/14276) - Replace templates inside class-string\<Foo<T>> by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14278](https://github.com/vimeo/psalm/pull/14278) - Fix TypeDoesNotContainType when narrowing a class\&interface intersection to a subclass by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14275](https://github.com/vimeo/psalm/pull/14275) - Apply by-reference captures of a closure only in the scope it was made in by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14281](https://github.com/vimeo/psalm/pull/14281) - Keep the key and value types when iterating over a nullable or falsable iterable by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14279](https://github.com/vimeo/psalm/pull/14279) - Narrow `$x` when `$x ??= $y` is compared with null by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14282](https://github.com/vimeo/psalm/pull/14282) - Infer open template params for new on a generic class without a constructor by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14277](https://github.com/vimeo/psalm/pull/14277) - Keep wider types on !== with a non-literal value by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14295](https://github.com/vimeo/psalm/pull/14295) - fix(throws): accept an intersection type in [@&#8203;throws](https://github.com/throws) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12896](https://github.com/vimeo/psalm/pull/12896) - feat(suppress): a [@&#8203;psalm-suppress](https://github.com/psalm-suppress) docblock in front of an argument suppresses the issues of its expression [#&#8203;5599](https://github.com/vimeo/psalm/issues/5599) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13288](https://github.com/vimeo/psalm/pull/13288) - fix(docblock): resolve imported aliases when checking an alias definition by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13230](https://github.com/vimeo/psalm/pull/13230) - fix(unused-code): a variable used only in the arguments of a static call on an undefined class is used by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12864](https://github.com/vimeo/psalm/pull/12864) - fix(templates): the called class maps the templates of an interface to those of a parent method by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13436](https://github.com/vimeo/psalm/pull/13436) - Decide a conditional on Closure for interfaces, iterables and bounded templates ([#&#8203;12497](https://github.com/vimeo/psalm/issues/12497)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12756](https://github.com/vimeo/psalm/pull/12756) - fix(purity): an impure instance method or constructor costs write-refs like an impure function by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13688](https://github.com/vimeo/psalm/pull/13688) - fix(arrays): report a write with an offset that may not be a key by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12812](https://github.com/vimeo/psalm/pull/12812) - fix(destructuring): a nullable shape destructured by key is no PossiblyNullArrayAccess, like a list by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13295](https://github.com/vimeo/psalm/pull/13295) - fix(array-key-exists): report a non-numeric string key checked on a list or int-keyed array by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13291](https://github.com/vimeo/psalm/pull/13291) - fix(class-string): do not check array literals as class names when the value type is a union by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12667](https://github.com/vimeo/psalm/pull/12667) - fix(types): expand properties-of for a class without instance properties by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12935](https://github.com/vimeo/psalm/pull/12935) - Fix `static` kept on the union of $this and another object of its class by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;14078](https://github.com/vimeo/psalm/pull/14078) - Analyse the arguments of a self call of an instance method once by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13315](https://github.com/vimeo/psalm/pull/13315) - Analyse the iterated expression of a foreach once by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13316](https://github.com/vimeo/psalm/pull/13316) - fix(callable): non-public static callbacks of the current class by class string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12875](https://github.com/vimeo/psalm/pull/12875) - fix(callable): a callable array naming a method declared by [@&#8203;method](https://github.com/method) is callable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12986](https://github.com/vimeo/psalm/pull/12986) - A call is only redundant if every assertion it makes is ([#&#8203;11847](https://github.com/vimeo/psalm/issues/11847)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12766](https://github.com/vimeo/psalm/pull/12766) - fix(assert): don't check an is\_\*() call inside assert() a second time by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12648](https://github.com/vimeo/psalm/pull/12648) - fix(empty): no RiskyTruthyFalsyComparison for a required key of a sealed shape by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12883](https://github.com/vimeo/psalm/pull/12883) - fix(templates): input types a non-template part of a union contains are not the template's by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13439](https://github.com/vimeo/psalm/pull/13439) - fix(templates): an omitted default equal to an atomic of the union does not bound the template by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12985](https://github.com/vimeo/psalm/pull/12985) - fix(templates): expand [@&#8203;psalm-if-this-is](https://github.com/psalm-if-this-is) type before binding templates by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12942](https://github.com/vimeo/psalm/pull/12942) - fix(templates): keep templates of the calling function-like in scope in traits by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13220](https://github.com/vimeo/psalm/pull/13220) - fix(algebra): the right side of && assigning an offset or property forgets only what the left side tested of it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13199](https://github.com/vimeo/psalm/pull/13199) - fix(switch): narrow the subject after a switch without default whose cases all return by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12972](https://github.com/vimeo/psalm/pull/12972) - fix(unset): report a variable unset in a branch as possibly undefined afterwards by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13126](https://github.com/vimeo/psalm/pull/13126) - Fix TypeError in && when the right side calls a closure capturing a variable by reference by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14303](https://github.com/vimeo/psalm/pull/14303) ##### Internal changes - Fail CI on PHP deprecations (PHPunit) and run Shepherd on PHP 8.6 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14229](https://github.com/vimeo/psalm/pull/14229) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.11.0...7.12.0> ### [`v7.11.0`](https://github.com/vimeo/psalm/releases/tag/7.11.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.10.0...7.11.0) <!-- Release notes generated using configuration in .github/release.yml at 9e0d0f88bc0a4233357a9aeb4b32da060644e196 --> #### What's Changed ##### Features - Report the CWE weaknesses of issues, and use the issue type as the SARIF rule id by [@&#8203;danog](https://github.com/danog) in [#&#8203;14156](https://github.com/vimeo/psalm/pull/14156) - Remove the taints a value can't carry once it matches an anchored pattern, or a list of words through a string cast by [@&#8203;danog](https://github.com/danog) in [#&#8203;14161](https://github.com/vimeo/psalm/pull/14161) - Require the Doctrine plugin, and enable it when composer.json requires Doctrine by [@&#8203;danog](https://github.com/danog) in [#&#8203;14165](https://github.com/vimeo/psalm/pull/14165) - Report weak hashes and ciphers, seeded random number generators, insecure cookies and XXE by [@&#8203;danog](https://github.com/danog) in [#&#8203;14160](https://github.com/vimeo/psalm/pull/14160) - Make what symfony/yaml parses with PARSE_OBJECT an unserialize sink by [@&#8203;danog](https://github.com/danog) in [#&#8203;14172](https://github.com/vimeo/psalm/pull/14172) ##### Fixes - \[6.x] Fix crash when a class extends a class_alias() declared later by [@&#8203;wleeaf](https://github.com/wleeaf) in [#&#8203;12494](https://github.com/vimeo/psalm/pull/12494) - Fix alter ignoring MissingThrowsDocblock suppression by [@&#8203;d-mitrofanov-v](https://github.com/d-mitrofanov-v) in [#&#8203;11586](https://github.com/vimeo/psalm/pull/11586) - Accept the $flags parameter of ArrayObject/ArrayIterator asort()/ksort() by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14127](https://github.com/vimeo/psalm/pull/14127) - Charge \_\_toString when builtins convert values or array values to strings by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14129](https://github.com/vimeo/psalm/pull/14129) - Taint the dynamic properties of a tainted object by [@&#8203;danog](https://github.com/danog) in [#&#8203;14162](https://github.com/vimeo/psalm/pull/14162) - Fix gettype() !== narrowing to a class named after the type by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14152](https://github.com/vimeo/psalm/pull/14152) - Analyse Foo::C and $foo::C with one helper (experimental) by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14153](https://github.com/vimeo/psalm/pull/14153) - Merge NamespaceStatementsDiffer into FileStatementsDiffer (experimental) by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14148](https://github.com/vimeo/psalm/pull/14148) - Analyze methods of another file through one helper keeping the root file by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14147](https://github.com/vimeo/psalm/pull/14147) - Taint what the preg_replace_callback() callback returns by [@&#8203;danog](https://github.com/danog) in [#&#8203;14067](https://github.com/vimeo/psalm/pull/14067) - Keep the taints of an array iterated with foreach when it can also be a string by [@&#8203;danog](https://github.com/danog) in [#&#8203;14168](https://github.com/vimeo/psalm/pull/14168) - \[Experimental] One builder per kind for the assertions of === and !== by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14155](https://github.com/vimeo/psalm/pull/14155) - Fix memory-limit option in psalm-refactor by [@&#8203;Aaqibhafeezkhan](https://github.com/Aaqibhafeezkhan) in [#&#8203;14070](https://github.com/vimeo/psalm/pull/14070) - Define the offsets before an offset asserted on a list by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14178](https://github.com/vimeo/psalm/pull/14178) - Give conditions built-in assertions only when the call resolves to the built-in function by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14151](https://github.com/vimeo/psalm/pull/14151) - Fix exponential analysis time of a negated in_array() over a literal list inside || by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;14072](https://github.com/vimeo/psalm/pull/14072) - fix(reports): escape control and bidi characters in the human-readable reports by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12804](https://github.com/vimeo/psalm/pull/12804) - fix(taint): link the arguments after the first one a variadic collects to its parameter by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13112](https://github.com/vimeo/psalm/pull/13112) - fix(assertions): [@&#8203;psalm-assert](https://github.com/psalm-assert) accepts an offset of an argument by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13005](https://github.com/vimeo/psalm/pull/13005) - fix(assert): an assertion on a scalar parameter does not narrow a mixed argument by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13895](https://github.com/vimeo/psalm/pull/13895) - Assert a non-empty string after file_exists, is_file and the other file tests by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12595](https://github.com/vimeo/psalm/pull/12595) - Fix crashes on first-class callables of inherited and provider-confirmed methods by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12124](https://github.com/vimeo/psalm/pull/12124) - Bind the method templates of the parent docblock an untyped override inherits by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;14073](https://github.com/vimeo/psalm/pull/14073) - Fix master CI: keep declared assertions of a call compared strictly to false by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14191](https://github.com/vimeo/psalm/pull/14191) - Fix template inference and a crash in static first-class callables by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14192](https://github.com/vimeo/psalm/pull/14192) ##### Internal changes - Dispatch the AddTaints/RemoveTaints handlers once per function call by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14144](https://github.com/vimeo/psalm/pull/14144) - Extract the shared tail of the simple assertion reconcilers by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14154](https://github.com/vimeo/psalm/pull/14154) - Authenticate PIE against GitHub when building the stub images by [@&#8203;danog](https://github.com/danog) in [#&#8203;14094](https://github.com/vimeo/psalm/pull/14094) - Deduplicate the console report formatting and the plugin enable/disable commands by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14149](https://github.com/vimeo/psalm/pull/14149) - Merge 6.x into master by [@&#8203;danog](https://github.com/danog) in [#&#8203;14166](https://github.com/vimeo/psalm/pull/14166) - Track classlike existence with one kind bitmask per name by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14146](https://github.com/vimeo/psalm/pull/14146) - Bump the perf corpus Drupal to 11.4.13 and split report issues by category by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14182](https://github.com/vimeo/psalm/pull/14182) - Remove the dead Context::$collect_mutations mode by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14145](https://github.com/vimeo/psalm/pull/14145) - Remove code for PHP versions Psalm no longer runs on by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14143](https://github.com/vimeo/psalm/pull/14143) - Move hard-coded callmap return types into return type providers by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14150](https://github.com/vimeo/psalm/pull/14150) - Fix line length in Refactor::LONG_OPTIONS by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14183](https://github.com/vimeo/psalm/pull/14183) #### New Contributors - [@&#8203;wleeaf](https://github.com/wleeaf) made their first contribution in [#&#8203;12494](https://github.com/vimeo/psalm/pull/12494) - [@&#8203;d-mitrofanov-v](https://github.com/d-mitrofanov-v) made their first contribution in [#&#8203;11586](https://github.com/vimeo/psalm/pull/11586) - [@&#8203;Aaqibhafeezkhan](https://github.com/Aaqibhafeezkhan) made their first contribution in [#&#8203;14070](https://github.com/vimeo/psalm/pull/14070) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.10.0...7.11.0> ### [`v7.10.0`](https://github.com/vimeo/psalm/releases/tag/7.10.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.9.0...7.10.0) <!-- Release notes generated using configuration in .github/release.yml at 2d8a48d1611508108eaa653ef599010da65eff3f --> #### What's Changed ##### Features - Array offsets: Report a `false` offset, which PHP turns into `0` by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12690](https://github.com/vimeo/psalm/pull/12690) - CLI: Add `--min-type-coverage` to fail below a type coverage minimum by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14075](https://github.com/vimeo/psalm/pull/14075) - Language server: Apply the baseline as the CLI does by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13775](https://github.com/vimeo/psalm/pull/13775) ##### Fixes - Docblock types: Recognize `non-empty-scalar` and similar types in namespaces by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14079](https://github.com/vimeo/psalm/pull/14079) - Docblock types: `empty-scalar` and `non-empty-scalar` no longer accept any scalar by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14080](https://github.com/vimeo/psalm/pull/14080) - Language server: Reject unrecognised short options by [@&#8203;jay23606](https://github.com/jay23606) in [#&#8203;13763](https://github.com/vimeo/psalm/pull/13763) - Loops: Report definite issues of a `do-while`'s first iteration, not `Possibly*` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14032](https://github.com/vimeo/psalm/pull/14032) - Loops: Report an argument issue once, not once per loop pass by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14103](https://github.com/vimeo/psalm/pull/14103) - Loops: Propagate types through nested `foreach` and references by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14099](https://github.com/vimeo/psalm/pull/14099) - Mixed: Keep a `mixed` variable `mixed` after an `if` that wrote its offsets by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14039](https://github.com/vimeo/psalm/pull/14039) - Mixed: Keep a `mixed` variable `mixed` after `else`, `switch`, `match` and `||` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14063](https://github.com/vimeo/psalm/pull/14063) - Mixed: Fix false `PossiblyUndefinedVariable` after `isset($var[$k])` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14065](https://github.com/vimeo/psalm/pull/14065) - Mixed: Fix false `InvalidArrayOffset` on nested writes by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14062](https://github.com/vimeo/psalm/pull/14062) - Named arguments: Report the right argument number by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14096](https://github.com/vimeo/psalm/pull/14096) - Narrowing: Narrow impossible `null` comparisons to `never` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14036](https://github.com/vimeo/psalm/pull/14036) - Narrowing: Narrow exhaustive `instanceof` checks to `never` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14048](https://github.com/vimeo/psalm/pull/14048) - Narrowing: Fix false contradictions on `===` between overlapping types by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14037](https://github.com/vimeo/psalm/pull/14037) - Narrowing: `class_exists()` narrows only inside its `if` block by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13391](https://github.com/vimeo/psalm/pull/13391) - Narrowing: `$a?->m() ?? false` narrows `$a` to non-null by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12995](https://github.com/vimeo/psalm/pull/12995) - Narrowing: Narrow variables bound by reference in conditions by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14101](https://github.com/vimeo/psalm/pull/14101) - Property hooks: Fix `__METHOD__` and false `LessSpecificReturnType` by [@&#8203;danog](https://github.com/danog) in [#&#8203;14066](https://github.com/vimeo/psalm/pull/14066) - PHP 8.6: Allow `#[\Override]` on class constants and enum cases by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14038](https://github.com/vimeo/psalm/pull/14038) - Plugins: Resolve class names in all type declarations of the AST by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14134](https://github.com/vimeo/psalm/pull/14134) - Properties: Forget property items a called method writes by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14027](https://github.com/vimeo/psalm/pull/14027) - Purity: Account for implicit `__toString()` calls by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;13782](https://github.com/vimeo/psalm/pull/13782) - Stubs: `filter_var(null)` returns `''` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14124](https://github.com/vimeo/psalm/pull/14124) - Stubs: `libxml_set_external_entity_loader()` is not an unused call by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14118](https://github.com/vimeo/psalm/pull/14118) - Stubs: `pathinfo()` may omit `dirname` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14122](https://github.com/vimeo/psalm/pull/14122) - Stubs: Fix write-only by-reference params of `proc_open()` and others by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14100](https://github.com/vimeo/psalm/pull/14100) - Stubs: Fix `SplObjectStorage` value checks and param names by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14121](https://github.com/vimeo/psalm/pull/14121) - Stubs: `stream_get_meta_data()` keys may be undefined by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14095](https://github.com/vimeo/psalm/pull/14095) - Templates: Narrow `key-of<T>`/`value-of<T>` instead of reporting contradictions by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14041](https://github.com/vimeo/psalm/pull/14041) - Templates: Use the bound of `key-of<T>`/`value-of<T>` in operations by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14064](https://github.com/vimeo/psalm/pull/14064) - Templates: Narrow to `key-of<T>`/`value-of<T>` after `array_key_exists()`/`in_array()` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14034](https://github.com/vimeo/psalm/pull/14034) - Templates: Keep `string` in an `array|scalar` argument to a `string|array` template by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14098](https://github.com/vimeo/psalm/pull/14098) - Templates: Report a type conflict at the write that causes it by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14102](https://github.com/vimeo/psalm/pull/14102) - Type coverage: Don't count deleted files on cached runs by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14077](https://github.com/vimeo/psalm/pull/14077) ##### Internal changes - Self-analysis: Fix `ComplexMethod` on `IfElseAnalyzer::analyze()` by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14088](https://github.com/vimeo/psalm/pull/14088) - Tests: Cover `unset()` of an offset in an `isset()` branch by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13123](https://github.com/vimeo/psalm/pull/13123) #### New Contributors - [@&#8203;jay23606](https://github.com/jay23606) made their first contribution in [#&#8203;13763](https://github.com/vimeo/psalm/pull/13763) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.9.0...7.10.0> ### [`v7.9.0`](https://github.com/vimeo/psalm/releases/tag/7.9.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.8.0...7.9.0) <!-- Release notes generated using configuration in .github/release.yml at 6b439ac5947fccc105ec83faf60568d15e24d2a9 --> #### What's Changed ##### Features - Analyse references to properties by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13955](https://github.com/vimeo/psalm/pull/13955) ##### Fixes - Fix explode() return type with a negative limit by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13949](https://github.com/vimeo/psalm/pull/13949) - Report native return types disjoint from the inherited [@&#8203;return](https://github.com/return) docblock by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13951](https://github.com/vimeo/psalm/pull/13951) - Narrow strings by strlen() comparisons that imply non-emptiness one way by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13953](https://github.com/vimeo/psalm/pull/13953) - Drop null from the left side of ?? on ArrayAccess offsets ([#&#8203;9960](https://github.com/vimeo/psalm/issues/9960)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12738](https://github.com/vimeo/psalm/pull/12738) - Don't assume an implicit null return after exhaustive type checks by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13952](https://github.com/vimeo/psalm/pull/13952) - Cast numeric-string and float array keys to int by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13956](https://github.com/vimeo/psalm/pull/13956) - Take an offset bound by reference as created, and its null array as an array by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13954](https://github.com/vimeo/psalm/pull/13954) - Narrow loop counters with the exit condition and inc/dec conditions by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13950](https://github.com/vimeo/psalm/pull/13950) - Do not make a key optional when the unsealed arrays lacking it may hold it by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13904](https://github.com/vimeo/psalm/pull/13904) - Narrow the receiver of a nullsafe chain that is not identical to null by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12701](https://github.com/vimeo/psalm/pull/12701) - Fix superglobal made nullable by global by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13973](https://github.com/vimeo/psalm/pull/13973) - Fix UndefinedVariable in isset() after a switch whose later case ends in a conditional throw by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13974](https://github.com/vimeo/psalm/pull/13974) - Fix: RedundantCondition on a nullsafe fetch compared to a bool literal by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13945](https://github.com/vimeo/psalm/pull/13945) - Fix crash destructuring an ArrayAccess object of self by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;13785](https://github.com/vimeo/psalm/pull/13785) - Fix: nullsafe fetch on an unread non-null property receiver is typed nullable by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13946](https://github.com/vimeo/psalm/pull/13946) - Resolve static in template arguments when comparing inherited signatures by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14000](https://github.com/vimeo/psalm/pull/14000) - Fix: PHP 8.6 SodiumCryptoXof\*State classes are undefined by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14013](https://github.com/vimeo/psalm/pull/14013) - Handle break 2 out of a nested switch by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13991](https://github.com/vimeo/psalm/pull/13991) - Fix UnusedVariable for an assignment before a break or in a catch read after the enclosing if by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13981](https://github.com/vimeo/psalm/pull/13981) - Narrow the value a loop exits with through ++/-- in its condition by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13992](https://github.com/vimeo/psalm/pull/13992) - Fix UndefinedVariable for a variable assigned in a nested && operand by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13976](https://github.com/vimeo/psalm/pull/13976) - Fix: properties of builtin classes known only through reflection are mixed by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14015](https://github.com/vimeo/psalm/pull/14015) - Keep the memoized result of a call that may change it by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13990](https://github.com/vimeo/psalm/pull/13990) - Fix: `curl_multi_get_handles()` returns `array<array-key, mixed>` instead of `list<CurlHandle>` by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14022](https://github.com/vimeo/psalm/pull/14022) - Fix: PHP 8.6 global constants are undefined when Psalm runs on PHP < 8.6 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14024](https://github.com/vimeo/psalm/pull/14024) - Fix: a parent's [@&#8203;method](https://github.com/method) overriding a non-public method of the child where the call reaches it by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14016](https://github.com/vimeo/psalm/pull/14016) - Replace characters XML 1.0 forbids in checkstyle and JUnit reports by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14025](https://github.com/vimeo/psalm/pull/14025) - Fix: PHP 8.6 signatures of `socket_addrinfo_lookup()`, `socket_cmsg_space()` and `ldap_free_result()` by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14023](https://github.com/vimeo/psalm/pull/14023) - Inherit Iterator methods on interfaces extending RecursiveIterator and other internal interfaces by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14026](https://github.com/vimeo/psalm/pull/14026) - Take superglobals passed by reference as set by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14035](https://github.com/vimeo/psalm/pull/14035) - array_key_exists() removes null and false from the array where it is true by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13975](https://github.com/vimeo/psalm/pull/13975) - Don't accept an object with \_\_toString() for a string in overridden method types by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;14029](https://github.com/vimeo/psalm/pull/14029) ##### Internal changes - Re-enable skipped tests that pass, link the others to their issues by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13935](https://github.com/vimeo/psalm/pull/13935) - Fix ComplexMethod on SwitchCaseAnalyzer::analyze() in self-analysis by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13996](https://github.com/vimeo/psalm/pull/13996) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.8.0...7.9.0> ### [`v7.8.0`](https://github.com/vimeo/psalm/releases/tag/7.8.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.7.0...7.8.0) <!-- Release notes generated using configuration in .github/release.yml at 60e0a00e920b619377e44f7359b2b79c5463b585 --> #### What's Changed ##### Features - Analyse property hook bodies by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13911](https://github.com/vimeo/psalm/pull/13911) - Add `markAllNonInternalCodeAsApi` for libraries, and make the code a project doesn't ship internal by [@&#8203;danog](https://github.com/danog) in [#&#8203;13939](https://github.com/vimeo/psalm/pull/13939) ##### Fixes - Don't add literals computed from what a loop changes by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13902](https://github.com/vimeo/psalm/pull/13902) - Keep the narrowing of a boolean flag after a condition on the same array offset by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13905](https://github.com/vimeo/psalm/pull/13905) - Fix false PossiblyUndefinedArrayOffset after a loop that breaks on isset() by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13903](https://github.com/vimeo/psalm/pull/13903) - Run the taint handlers psalm registers in the invalid taint cases too by [@&#8203;danog](https://github.com/danog) in [#&#8203;13653](https://github.com/vimeo/psalm/pull/13653) - Don't report what die, exit and unpacked arguments of printf() and the like print from CLI code by [@&#8203;danog](https://github.com/danog) in [#&#8203;13652](https://github.com/vimeo/psalm/pull/13652) - Add the implicit null to the inferred type of closures falling off their end by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13910](https://github.com/vimeo/psalm/pull/13910) - Fix false PossiblyUndefinedVariable after a loop for a variable assigned before every continue by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13906](https://github.com/vimeo/psalm/pull/13906) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.7.0...7.8.0> ### [`v7.7.0`](https://github.com/vimeo/psalm/releases/tag/7.7.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.6.0...7.7.0) <!-- Release notes generated using configuration in .github/release.yml at 0fd455bdcb8d4385c1b4b2fd81e1cb85b8625518 --> #### What's Changed ##### Features - feat(reconciler): a non-empty string that is not "0" is non-falsy by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13132](https://github.com/vimeo/psalm/pull/13132) - feat(instanceof): report instanceof iterable as a reserved word by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13093](https://github.com/vimeo/psalm/pull/13093) - Infer bounded ranges for |, ^, & and << on int ranges ([#&#8203;9902](https://github.com/vimeo/psalm/issues/9902)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12737](https://github.com/vimeo/psalm/pull/12737) - Infer templates when invoking generic first-class callables by [@&#8203;nicolas-grekas](https://github.com/nicolas-grekas) in [#&#8203;12714](https://github.com/vimeo/psalm/pull/12714) - Don't report MissingClassConstType for final constants by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13889](https://github.com/vimeo/psalm/pull/13889) ##### Fixes - Don't make an array shape key optional because its value was possibly undefined by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12702](https://github.com/vimeo/psalm/pull/12702) - fix(loops): a variable a break leaves undefined is possibly undefined after the loop by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13089](https://github.com/vimeo/psalm/pull/13089) - fix(docblocks): an override documenting only some params inherits the others' types from the parent [#&#8203;13161](https://github.com/vimeo/psalm/issues/13161) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13271](https://github.com/vimeo/psalm/pull/13271) - Fix false PossiblyUndefinedVariable after reference bindings and elseif condition assignments by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13795](https://github.com/vimeo/psalm/pull/13795) - Keep getter results after calls to methods whose body writes nothing by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13793](https://github.com/vimeo/psalm/pull/13793) - Keep the narrowing of the other variables of an if or elseif condition assigned to a variable by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13794](https://github.com/vimeo/psalm/pull/13794) - fix(references): a reference a branch or loop rebinds is detached from the variable it was bound to by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13707](https://github.com/vimeo/psalm/pull/13707) - Fix unsound negations of conditions with parts that can't be negated by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13813](https://github.com/vimeo/psalm/pull/13813) - fix(class-exists): the class of a negated class_exists() is only phantom after the first statement of the block by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13293](https://github.com/vimeo/psalm/pull/13293) - fix(closure): don't keep the capture-time literal of a variable captured by reference by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13215](https://github.com/vimeo/psalm/pull/13215) - Allow public(set) on readonly properties by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13817](https://github.com/vimeo/psalm/pull/13817) - Keep '0' in strings that are loosely != null by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13819](https://github.com/vimeo/psalm/pull/13819) - fix(type): make union comparison independent of member order [#&#8203;3957](https://github.com/vimeo/psalm/issues/3957) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13709](https://github.com/vimeo/psalm/pull/13709) - Don't report a condition as already asserted when its key or property changed by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13818](https://github.com/vimeo/psalm/pull/13818) - fix(foreach): a foreach by reference that writes every item leaves the written type in the array [#&#8203;4292](https://github.com/vimeo/psalm/issues/4292) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13273](https://github.com/vimeo/psalm/pull/13273) - fix(return-types): do not suggest never for an overridable method that always throws [#&#8203;9604](https://github.com/vimeo/psalm/issues/9604) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13289](https://github.com/vimeo/psalm/pull/13289) - fix(traits): self and static of a trait method refer to the class it ends up in when comparing signatures by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12678](https://github.com/vimeo/psalm/pull/12678) - fix(array-fetch): a remembered offset does not hide the null of the array it is read from by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13693](https://github.com/vimeo/psalm/pull/13693) - fix(assert): resolve self in an assertion of a trait method to the class using it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13232](https://github.com/vimeo/psalm/pull/13232) - fix(foreach): a mixed value iterated by foreach may still be empty after it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12686](https://github.com/vimeo/psalm/pull/12686) - Type the matches of the preg_replace_callback callback as nullable with PREG_UNMATCHED_AS_NULL by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12608](https://github.com/vimeo/psalm/pull/12608) - fix(loop): keep the assigned type of a do-while condition variable after the loop by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13359](https://github.com/vimeo/psalm/pull/13359) - fix(arrays): report an offset that can't be an array key when assigning to an array by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13180](https://github.com/vimeo/psalm/pull/13180) - fix(types): a space inside a type name is a syntax error by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12819](https://github.com/vimeo/psalm/pull/12819) - fix(reconciler): a loose comparison with a string keeps an object with \_\_toString by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13113](https://github.com/vimeo/psalm/pull/13113) - fix(enum): resolve global constants as enum case values by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12841](https://github.com/vimeo/psalm/pull/12841) - fix(references): report more non-variable arguments of by-reference parameters by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12791](https://github.com/vimeo/psalm/pull/12791) - Infer an object cast of an array, scalar or null as an stdClass by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12723](https://github.com/vimeo/psalm/pull/12723) - fix(types): an array shape as the type of a [@&#8203;method](https://github.com/method) parameter by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13781](https://github.com/vimeo/psalm/pull/13781) - fix(callmap): language constructs are not functions by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13360](https://github.com/vimeo/psalm/pull/13360) - Apply loop conditions only where they hold by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13824](https://github.com/vimeo/psalm/pull/13824) - Tell apart conditions whose assertions had the same identity by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13828](https://github.com/vimeo/psalm/pull/13828) - Fix: language server crash after an interface method is renamed by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13783](https://github.com/vimeo/psalm/pull/13783) - Fix crash on a missing trait while following a method for property initialization by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13784](https://github.com/vimeo/psalm/pull/13784) - Drop the clauses about a variable once it is reassigned by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13829](https://github.com/vimeo/psalm/pull/13829) - Keep the classes checked with class_exists() on both sides of && and || by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12609](https://github.com/vimeo/psalm/pull/12609) - Type the variables after while (true) from its breaks only by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13833](https://github.com/vimeo/psalm/pull/13833) - Resolve type variables in the results of closure, function and static calls by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13840](https://github.com/vimeo/psalm/pull/13840) - Taint: don't share the by-reference out node of an inferred-pure callee across its calls by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13826](https://github.com/vimeo/psalm/pull/13826) - Name the left operand of ?? in issue messages instead of a tmp coalesce var by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12594](https://github.com/vimeo/psalm/pull/12594) - fix(reconciler): a comparison narrows the bound of a template by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12601](https://github.com/vimeo/psalm/pull/12601) - fix(new): report UnsafeInstantiation for new on an object by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12867](https://github.com/vimeo/psalm/pull/12867) - fix(property): name the object in property assignment messages by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12901](https://github.com/vimeo/psalm/pull/12901) - fix(filter_var): the default filter supports FILTER_FLAG_EMPTY_STRING_NULL by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12828](https://github.com/vimeo/psalm/pull/12828) - fix(array_merge): put the elements after an array of unknown length into its rest by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13257](https://github.com/vimeo/psalm/pull/13257) - Validate writes to interface property hooks by [@&#8203;MohannadElemary](https://github.com/MohannadElemary) in [#&#8203;13467](https://github.com/vimeo/psalm/pull/13467) - Document missing CLI options in `help` by [@&#8203;MrYamous](https://github.com/MrYamous) in [#&#8203;13744](https://github.com/vimeo/psalm/pull/13744) - Pass $final when expanding the members of an intersection by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13852](https://github.com/vimeo/psalm/pull/13852) - Keep a union that TypeExpander leaves unchanged by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13848](https://github.com/vimeo/psalm/pull/13848) - Don't leak the narrowing of a ternary or ?? condition into the outer scope by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13847](https://github.com/vimeo/psalm/pull/13847) - Fix the context after an if whose condition or body narrows by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13832](https://github.com/vimeo/psalm/pull/13832) - Re-analyse a loop for variables defined before continue, not because an issue was recorded by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13856](https://github.com/vimeo/psalm/pull/13856) - Infer method templates when calling a first-class callable of a bound generic object by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13855](https://github.com/vimeo/psalm/pull/13855) - fix(callable): a protected callback is accessible from a parent class's method by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12910](https://github.com/vimeo/psalm/pull/12910) - fix(nullsafe): narrow the receiver and the value of a checked nullsafe property fetch by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13121](https://github.com/vimeo/psalm/pull/13121) - fix(assertions): trait_exists() with a false autoload argument asserts a trait-string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13748](https://github.com/vimeo/psalm/pull/13748) - fix(coalesce): variables assigned in the call on the left of ?? are set on the right by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12990](https://github.com/vimeo/psalm/pull/12990) - fix(assertions): a nullsafe fetch identical to a non-null variable asserts its receiver by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12830](https://github.com/vimeo/psalm/pull/12830) - Narrow a class comparison only for ::class, not for other class constants by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12735](https://github.com/vimeo/psalm/pull/12735) - Check the constructor arguments of new on a class-string whose constructor can't change by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12706](https://github.com/vimeo/psalm/pull/12706) - Fix false RedundantCondition on loop condition after an offset unset in an if by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13861](https://github.com/vimeo/psalm/pull/13861) - fix(algebra): negate a condition assigning on the right of && or || from the negated condition [#&#8203;13739](https://github.com/vimeo/psalm/issues/13739) by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13868](https://github.com/vimeo/psalm/pull/13868) - Widen int ranges a loop keeps shifting past the analysed passes by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13865](https://github.com/vimeo/psalm/pull/13865) - Fix the narrowing of nullsafe call receivers and of variables reassigned on the right of an && by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13864](https://github.com/vimeo/psalm/pull/13864) - Narrow through boolean flags set from calls, and keep them across offset writes by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13867](https://github.com/vimeo/psalm/pull/13867) - Fix false PossiblyUndefinedArrayOffset after an isset() check on a list by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13866](https://github.com/vimeo/psalm/pull/13866) - Taint: keep the flow through a static call of an inherited method through a subclass by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13870](https://github.com/vimeo/psalm/pull/13870) - fix(algebra): count a variable passed by reference in a condition as assigned there [#&#8203;13739](https://github.com/vimeo/psalm/issues/13739) by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13879](https://github.com/vimeo/psalm/pull/13879) - fix(parser): report a duplicate type in a native union by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13131](https://github.com/vimeo/psalm/pull/13131) - fix(switch): use the variables of breaks for a case whose end is unreachable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13385](https://github.com/vimeo/psalm/pull/13385) - fix(analysis): escape string offsets in array variable ids by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13086](https://github.com/vimeo/psalm/pull/13086) - Widen int ranges a loop keeps shifting in array values by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13880](https://github.com/vimeo/psalm/pull/13880) - Fix assertions on self::$prop and static::$prop called from outside the class by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13891](https://github.com/vimeo/psalm/pull/13891) - Keep what the right operand of && writes or forgets after the expression by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13888](https://github.com/vimeo/psalm/pull/13888) - Update the holding arrays on a nested unset by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13884](https://github.com/vimeo/psalm/pull/13884) - Report reads before a later assignment in a loop as possibly undefined by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13885](https://github.com/vimeo/psalm/pull/13885) - Keep the truthy clause of a nullable int in the branches it guards by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13892](https://github.com/vimeo/psalm/pull/13892) - Fix: an object-shape part `object{}` of an intersection makes method calls mixed by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13876](https://github.com/vimeo/psalm/pull/13876) ##### Internal changes - Perf: serialize storages without keeping their property tables (cold run of a big app: -18 % peak memory, -7 % wall) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13593](https://github.com/vimeo/psalm/pull/13593) #### New Contributors - [@&#8203;MrYamous](https://github.com/MrYamous) made their first contribution in [#&#8203;13744](https://github.com/vimeo/psalm/pull/13744) - [@&#8203;nicolas-grekas](https://github.com/nicolas-grekas) made their first contribution in [#&#8203;12714](https://github.com/vimeo/psalm/pull/12714) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.6.0...7.7.0> ### [`v7.6.0`](https://github.com/vimeo/psalm/releases/tag/7.6.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.5.0...7.6.0) <!-- Release notes generated using configuration in .github/release.yml at 4303c7dbbc23efaac3d988707b4acf4d5508a9cc --> #### What's Changed ##### Features - Make allowStringToStandInForClass consistent across class-string usages by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13702](https://github.com/vimeo/psalm/pull/13702) - Add `Codebase::addReportableFiles()` to report issues in files Psalm doesn't analyze by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13725](https://github.com/vimeo/psalm/pull/13725) - Narrow array_filter() results with first-class callable callbacks by [@&#8203;kamil-tekiela](https://github.com/kamil-tekiela) in [#&#8203;12524](https://github.com/vimeo/psalm/pull/12524) - Narrow a string to empty or non-empty from strlen() compared with 0 or 1 by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12597](https://github.com/vimeo/psalm/pull/12597) - Report a float that loses its fraction as an operand of a bitwise or modulo operation by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12623](https://github.com/vimeo/psalm/pull/12623) ##### Fixes - fix(algebra): an operand of an || that can never be true is paradoxical by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13689](https://github.com/vimeo/psalm/pull/13689) - fix(reconciler): a lowercase or literal string can be asserted to be the name of a class or a callable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13685](https://github.com/vimeo/psalm/pull/13685) - fix(reconciler): !is_iterable() drops the objects that are Traversable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13686](https://github.com/vimeo/psalm/pull/13686) - Fix false positive null array access diagnostics in unset() by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13663](https://github.com/vimeo/psalm/pull/13663) - Fix dynamic method call reachability in unused code analysis by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13668](https://github.com/vimeo/psalm/pull/13668) - fix(algebra): a not-null check after isset() of the same variable is redundant by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13692](https://github.com/vimeo/psalm/pull/13692) - fix(scope): a switch default that falls through without returning does not end the function by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13684](https://github.com/vimeo/psalm/pull/13684) - fix(unused): a read in a try body after an assignment does not use the values the assignment overwrote by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13704](https://github.com/vimeo/psalm/pull/13704) - fix(reconciler): array_key_exists() of a string in an array of int keys narrows it to the keys as strings by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13690](https://github.com/vimeo/psalm/pull/13690) - fix(properties): a class extending a universal object crate keeps the properties it declares by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13703](https://github.com/vimeo/psalm/pull/13703) - fix(reconciler): a negated isset of a possibly undefined variable is null by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13706](https://github.com/vimeo/psalm/pull/13706) - Fix `@mixin` lookup order: own, traits, parents; first declared wins by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13694](https://github.com/vimeo/psalm/pull/13694) - Print exact types in argument, return type and signature mismatch messages by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13717](https://github.com/vimeo/psalm/pull/13717) - Fix crash when Psalm is used as a library without a check method (nullable `$project_files`) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13719](https://github.com/vimeo/psalm/pull/13719) - Fix stubs that redeclare properties of builtin or already stubbed classes by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13720](https://github.com/vimeo/psalm/pull/13720) - Don't report an || operand reading a variable the condition assigns by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13724](https://github.com/vimeo/psalm/pull/13724) - Fix overly broad invalidation of memoized getters after unrelated object mutations by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13662](https://github.com/vimeo/psalm/pull/13662) - fix(context): a block that forgot a variable leaves its type as it was before the block by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13705](https://github.com/vimeo/psalm/pull/13705) - Fix: an inaccessible method hides the mixin method reached through `__call()` by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13727](https://github.com/vimeo/psalm/pull/13727) - Keep the key and value types of a negated iterable assertion on Traversable by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13732](https://github.com/vimeo/psalm/pull/13732) - Treat the bound of a template a receiver leaves out as a stand-in by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13733](https://github.com/vimeo/psalm/pull/13733) - Resolve static::$p to its property when it is passed by reference by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13730](https://github.com/vimeo/psalm/pull/13730) - Report a stringable object in the index column of array_column since PHP 8 by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13731](https://github.com/vimeo/psalm/pull/13731) - Keep the invariance check of a template nested in a generic param by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13729](https://github.com/vimeo/psalm/pull/13729) - Remember a property of an interface that a shape or a mixin gives by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13734](https://github.com/vimeo/psalm/pull/13734) - Nullsafe call compared to a bool literal no longer narrows its receiver to null by [@&#8203;0xABCD01](https://github.com/0xABCD01) in [#&#8203;13602](https://github.com/vimeo/psalm/pull/13602) - fix(algebra): four unsound simplifications of simplifyCNF() [#&#8203;13736](https://github.com/vimeo/psalm/issues/13736) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13745](https://github.com/vimeo/psalm/pull/13745) - fix(algebra): two clauses of one condition that are not reconcilable do not share a hash [#&#8203;13737](https://github.com/vimeo/psalm/issues/13737) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13747](https://github.com/vimeo/psalm/pull/13747) - fix(foreach): a key that isset() added to the item in a foreach by reference is not written back by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13691](https://github.com/vimeo/psalm/pull/13691) - A sealed array shape with optional keys can be a list ([#&#8203;11905](https://github.com/vimeo/psalm/issues/11905)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12763](https://github.com/vimeo/psalm/pull/12763) - fix(stubs): DateTime::createFromFormat() reports its false return like DateTimeImmutable's by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13350](https://github.com/vimeo/psalm/pull/13350) - Fix: Report an unparsable [@&#8203;method](https://github.com/method) return type instead of crashing by [@&#8203;yvo-niedrich](https://github.com/yvo-niedrich) in [#&#8203;13608](https://github.com/vimeo/psalm/pull/13608) - fix(cli): don't crash when clearing a cache directory another process writes to by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13418](https://github.com/vimeo/psalm/pull/13418) - Inherit the parent's [@&#8203;var](https://github.com/var) type for a redeclared property without one by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13746](https://github.com/vimeo/psalm/pull/13746) - extract() with EXTR_SKIP defines a possibly undefined variable by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13761](https://github.com/vimeo/psalm/pull/13761) - Report a possibly undefined variable at the use() of a closure and in an arrow function by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13760](https://github.com/vimeo/psalm/pull/13760) - Fix --alter for a variable defined by a previous loop iteration by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13759](https://github.com/vimeo/psalm/pull/13759) - Let stubs refine property types listed in PropertyMap by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13755](https://github.com/vimeo/psalm/pull/13755) - A possibly undefined variable reads and reconciles as null when undefined by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13762](https://github.com/vimeo/psalm/pull/13762) - Evaluate the keys of an array item before the value by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13758](https://github.com/vimeo/psalm/pull/13758) - fix(algebra): a native symbol guard of function_exists() is no PHP_VERSION_ID check [#&#8203;13736](https://github.com/vimeo/psalm/issues/13736) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13764](https://github.com/vimeo/psalm/pull/13764) - fix(types): do not crash on a type alias imported from a class that is not scanned yet by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13192](https://github.com/vimeo/psalm/pull/13192) - fix(property): honour [@&#8203;property](https://github.com/property) on assignment without \_\_set [#&#8203;5092](https://github.com/vimeo/psalm/issues/5092) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13711](https://github.com/vimeo/psalm/pull/13711) - fix(call): do not crash on a method call on a variable typed with an unresolvable static by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13191](https://github.com/vimeo/psalm/pull/13191) - fix(isset): isset() on a typed property of a class without a constructor is not redundant [#&#8203;10252](https://github.com/vimeo/psalm/issues/10252) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13286](https://github.com/vimeo/psalm/pull/13286) - fix(loops): a variable the loop condition always assigns is defined after the loop [#&#8203;7072](https://github.com/vimeo/psalm/issues/7072) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13266](https://github.com/vimeo/psalm/pull/13266) - Fix wrong-case property names in PropertyMap by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13771](https://github.com/vimeo/psalm/pull/13771) - Keep the type of a possibly undefined variable defined in some branches by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13751](https://github.com/vimeo/psalm/pull/13751) - fix(unused-code): don't report params of a method whose body isn't analysed as unused by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13384](https://github.com/vimeo/psalm/pull/13384) - Don't crash on a docblock return or assertion type that is empty by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12719](https://github.com/vimeo/psalm/pull/12719) - fix(conditions): keep what an elseif or else writes after the first branch updated the variable [#&#8203;10328](https://github.com/vimeo/psalm/issues/10328) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13281](https://github.com/vimeo/psalm/pull/13281) - fix(algebra): the clauses of an if or a switch case about a variable its condition assigns are dropped [#&#8203;13739](https://github.com/vimeo/psalm/issues/13739) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13770](https://github.com/vimeo/psalm/pull/13770) - fix(array): appending to a nested element of a sealed keyed array no longer asserts by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13029](https://github.com/vimeo/psalm/pull/13029) - fix(int-mask): two bit sets compared for equality are no ambiguous comparison by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13713](https://github.com/vimeo/psalm/pull/13713) - Keep self-contradicting conditions for the reconciler [#&#8203;13736](https://github.com/vimeo/psalm/issues/13736) by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13754](https://github.com/vimeo/psalm/pull/13754) - fix(docblock): an int-mask accepts a global constant used from a namespace by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13200](https://github.com/vimeo/psalm/pull/13200) ##### Docs - Document calling `addReportableFiles()` in the plugin entry point by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13728](https://github.com/vimeo/psalm/pull/13728) - Document the conditional default of findUnusedVariablesAndParams by [@&#8203;roxblnfk](https://github.com/roxblnfk) in [#&#8203;13750](https://github.com/vimeo/psalm/pull/13750) - Document how library authors help Psalm understand their package by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13773](https://github.com/vimeo/psalm/pull/13773) ##### Internal changes - Drop unneeded suppressions from invalid-code test cases by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13715](https://github.com/vimeo/psalm/pull/13715) - Drop ignored_issues entries that valid-code test cases never need by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13716](https://github.com/vimeo/psalm/pull/13716) - Split PsalmEndToEndTest so ParaTest runs its tests in parallel by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13722](https://github.com/vimeo/psalm/pull/13722) - Require psalm/psalm-plugin-api 0.4.5 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13735](https://github.com/vimeo/psalm/pull/13735) - Remove redundant branches and statements repeated in every branch by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13749](https://github.com/vimeo/psalm/pull/13749) - Disable CircleCI by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13752](https://github.com/vimeo/psalm/pull/13752) ##### Other changes - Find references to a method also where its return value is used by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;13667](https://github.com/vimeo/psalm/pull/13667) #### New Contributors - [@&#8203;0xABCD01](https://github.com/0xABCD01) made their first contribution in [#&#8203;13602](https://github.com/vimeo/psalm/pull/13602) - [@&#8203;yvo-niedrich](https://github.com/yvo-niedrich) made their first contribution in [#&#8203;13608](https://github.com/vimeo/psalm/pull/13608) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.5.0...7.6.0> ### [`v7.5.0`](https://github.com/vimeo/psalm/releases/tag/7.5.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.4.0...7.5.0) <!-- Release notes generated using configuration in .github/release.yml at 9520421041c4de67379270dc17502544dd808140 --> #### What's Changed ##### Features - Add [@&#8203;psalm-cli-only-instances](https://github.com/psalm-cli-only-instances): code requiring an instance of a class only instantiated from the command line is command-line code by [@&#8203;danog](https://github.com/danog) in [#&#8203;13635](https://github.com/vimeo/psalm/pull/13635) - Honour FORCE_COLOR and share color detection across CLIs by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13665](https://github.com/vimeo/psalm/pull/13665) - Exit with code 2 when psalter --dry-run would change files by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13666](https://github.com/vimeo/psalm/pull/13666) - Let plugins mark a file's top-level code as CLI-only by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13643](https://github.com/vimeo/psalm/pull/13643) ##### Fixes - fix(match): analyse a match(true) arm once for all its conditions by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12842](https://github.com/vimeo/psalm/pull/12842) - Perf: analyse an inherited constructor once per subclass (-5 to -9 % CPU) + fix false positive PropertyNotSetInConstructor by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13240](https://github.com/vimeo/psalm/pull/13240) - Fix: method with an unknown parameter class is analysed when its file is analysed again by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12547](https://github.com/vimeo/psalm/pull/12547) - fix(control-flow): preserve outer loop exits across switch cases [#&#8203;13620](https://github.com/vimeo/psalm/issues/13620) by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13627](https://github.com/vimeo/psalm/pull/13627) - Fix unused variable detection for references returned by functions by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13623](https://github.com/vimeo/psalm/pull/13623) - Name the compared operator in int range comparison messages ([#&#8203;12109](https://github.com/vimeo/psalm/issues/12109)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12762](https://github.com/vimeo/psalm/pull/12762) - fix(templates): resolve a method call on a template bounded by another template by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13107](https://github.com/vimeo/psalm/pull/13107) - fix(closure): a closure that calls itself through a by-reference use has its own signature there by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13077](https://github.com/vimeo/psalm/pull/13077) - Fix: analyse a file's namespace-level statements once, not for every subclass that follows into it (mediawiki -33 % CPU) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13592](https://github.com/vimeo/psalm/pull/13592) - Fix: invalid file:// links for paths with spaces and Windows drives by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13664](https://github.com/vimeo/psalm/pull/13664) - fix(parser): read built-in constants without their deprecation by [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) in [#&#8203;13601](https://github.com/vimeo/psalm/pull/13601) - \[7.x] Keep taint graph nodes as compact rows: worker results \~600 MB → 170 MB, main peak -1.1 GB by [@&#8203;jarstelfox](https://github.com/jarstelfox) in [#&#8203;13536](https://github.com/vimeo/psalm/pull/13536) - Fix: psalter rejects the advertised `--monochrome` option by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13669](https://github.com/vimeo/psalm/pull/13669) - Fix: generic [@&#8203;mixin](https://github.com/mixin) binds static to an earlier mixin declaring the same method by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13673](https://github.com/vimeo/psalm/pull/13673) - Fix: psalm-refactor --move and --rename never work by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13679](https://github.com/vimeo/psalm/pull/13679) - Fix: --show-info, --report-show-info and --threads misread their values by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13680](https://github.com/vimeo/psalm/pull/13680) - Fix: options after a path are ignored, so psalter --dry-run can rewrite files by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13678](https://github.com/vimeo/psalm/pull/13678) - Fix: psalter --file, --plugin and --codeowner resolve paths wrongly by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13681](https://github.com/vimeo/psalm/pull/13681) - Fix: psalm - (paths from STDIN) and empty path arguments crash by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13682](https://github.com/vimeo/psalm/pull/13682) - Fix: a class's own [@&#8203;mixin](https://github.com/mixin) replaces the mixins inherited from its parent by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13687](https://github.com/vimeo/psalm/pull/13687) ##### Internal changes - Readable psalter output by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13656](https://github.com/vimeo/psalm/pull/13656) - Perf: read a location's compact state without a property table (taint, 1 thread: -1.8 % peak memory) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13674](https://github.com/vimeo/psalm/pull/13674) - Require psalm/psalm-plugin-api 0.4.3 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13683](https://github.com/vimeo/psalm/pull/13683) ##### Other changes - feat(callable): report a callable that takes a parameter by reference where it is called with a value by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13548](https://github.com/vimeo/psalm/pull/13548) - fix(conditions): ignore what the left of an or tested of a variable the right reassigns by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13179](https://github.com/vimeo/psalm/pull/13179) #### New Contributors - [@&#8203;shu-chen-dot-ca](https://github.com/shu-chen-dot-ca) made their first contribution in [#&#8203;13601](https://github.com/vimeo/psalm/pull/13601) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.4.0...7.5.0> ### [`v7.4.0`](https://github.com/vimeo/psalm/releases/tag/7.4.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.3.2...7.4.0) <!-- Release notes generated using configuration in .github/release.yml at master --> #### What's Changed ##### Features - Report calls of [@&#8203;psalm-cli-only](https://github.com/psalm-cli-only) code from code that may not run from the command line by [@&#8203;danog](https://github.com/danog) in [#&#8203;13611](https://github.com/vimeo/psalm/pull/13611) - Allow [@&#8203;psalm-assert](https://github.com/psalm-assert) on PHP_SAPI, so a guard function marks the code after it as command-line code by [@&#8203;danog](https://github.com/danog) in [#&#8203;13633](https://github.com/vimeo/psalm/pull/13633) ##### Fixes - Fix: initialize plugins before scanning the Composer autoload files in a full run by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13591](https://github.com/vimeo/psalm/pull/13591) ##### Other changes - Don't let stuck runs skip every phar build by [@&#8203;muglug](https://github.com/muglug) in [#&#8203;13630](https://github.com/vimeo/psalm/pull/13630) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.3.2...7.4.0> ### [`v7.3.2`](https://github.com/vimeo/psalm/releases/tag/7.3.2) [Compare Source](https://github.com/vimeo/psalm/compare/7.3.1...7.3.2) <!-- Release notes generated using configuration in .github/release.yml at 5ae5547150b3b097f8027e64770abaf1a5ef761c --> #### What's Changed ##### Fixes - fix(callable): a first-class callable of a method keeps its inherited return type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12800](https://github.com/vimeo/psalm/pull/12800) - fix(conditions): forget what the left of && tested of a variable that its right assigns by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12655](https://github.com/vimeo/psalm/pull/12655) - fix(unused): see assignments of a try branch that throws after the try by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13122](https://github.com/vimeo/psalm/pull/13122) - fix(isset): a property missing on one member of a union is null for isset by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12689](https://github.com/vimeo/psalm/pull/12689) - Define the variables assigned in the condition of a while or for loop after the loop by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12717](https://github.com/vimeo/psalm/pull/12717) - fix(conditions): don't report paths below an assigned variable as redundant in and/or chains by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13292](https://github.com/vimeo/psalm/pull/13292) - Report instanceof of an implied interface, not instanceof of a class-string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12626](https://github.com/vimeo/psalm/pull/12626) - Combine the variables of all catches when the try block always throws by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12727](https://github.com/vimeo/psalm/pull/12727) - Psalter: leave a docblock as written when no [@&#8203;return](https://github.com/return) tag changes by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13624](https://github.com/vimeo/psalm/pull/13624) - Apply what plugins remove from a call's result wherever the result flows by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13626](https://github.com/vimeo/psalm/pull/13626) ##### Internal changes - Perf: scan files from a warm cache without forking (big app warm run: -14 % wall, -15 % CPU, -13 % memory) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13251](https://github.com/vimeo/psalm/pull/13251) ##### Other changes - Remove redundant CS checks in circleCI by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13628](https://github.com/vimeo/psalm/pull/13628) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.3.1...7.3.2> ### [`v7.3.1`](https://github.com/vimeo/psalm/releases/tag/7.3.1) [Compare Source](https://github.com/vimeo/psalm/compare/7.3.0...7.3.1) <!-- Release notes generated using configuration in .github/release.yml at 81bda61675df22fc4e5e1ceab1c33f4c61a4830b --> #### What's Changed ##### Fixes - Narrow arrays of the same keys that are identical to an array of overlapping item types by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12707](https://github.com/vimeo/psalm/pull/12707) - fix(memoization): keep a memoized call narrowed in the initialization pass by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13120](https://github.com/vimeo/psalm/pull/13120) - Keep a mixed variable mixed after a ternary that narrows it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12725](https://github.com/vimeo/psalm/pull/12725) - Fix: [@&#8203;method](https://github.com/method) of a used trait or parent class overriding a declared method by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13546](https://github.com/vimeo/psalm/pull/13546) - Fix parser caching for project paths containing vendor by [@&#8203;MohannadElemary](https://github.com/MohannadElemary) in [#&#8203;13491](https://github.com/vimeo/psalm/pull/13491) - fix(types): isset narrows optional properties of object shapes by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13409](https://github.com/vimeo/psalm/pull/13409) - fix(static-properties): forget a static property after a call to a method that assigns it [#&#8203;10705](https://github.com/vimeo/psalm/issues/10705) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13262](https://github.com/vimeo/psalm/pull/13262) - fix(conditional): a value is never of the type never in a conditional return type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13433](https://github.com/vimeo/psalm/pull/13433) - Don't let the conditions of the caller reach a method analysed inline by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12732](https://github.com/vimeo/psalm/pull/12732) - fix(docblock): reject the removed self-accessing/self-mutating callables with params by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12776](https://github.com/vimeo/psalm/pull/12776) - fix(types): '0' is a non-empty-lowercase-string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12832](https://github.com/vimeo/psalm/pull/12832) - fix(templates): keep the key of a list when its template types are replaced by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12837](https://github.com/vimeo/psalm/pull/12837) - fix(array_pop): an optional last item of a list may leave the previous one popped by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12825](https://github.com/vimeo/psalm/pull/12825) - fix(alter): replace a whole union return type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12876](https://github.com/vimeo/psalm/pull/12876) - Name the element of psalm.xml a config path error comes from by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12616](https://github.com/vimeo/psalm/pull/12616) - fix(types): validate refined stringable arguments by [@&#8203;1cbyc](https://github.com/1cbyc) in [#&#8203;13472](https://github.com/vimeo/psalm/pull/13472) - fix(functions): bind the template of a conditional return type whatever the casing of the call by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12656](https://github.com/vimeo/psalm/pull/12656) - Report an int range offset that partly fits the keys of an array as possibly invalid by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12710](https://github.com/vimeo/psalm/pull/12710) - fix(shapes): keep an optional key of an unsealed shape through isset and the join of branches by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12646](https://github.com/vimeo/psalm/pull/12646) - Resolve self of a trait method's return type to the class using the trait ([#&#8203;4047](https://github.com/vimeo/psalm/issues/4047)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12742](https://github.com/vimeo/psalm/pull/12742) - fix(calls): name the callable in TooFewArguments and TooManyArguments by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12637](https://github.com/vimeo/psalm/pull/12637) - fix(callable): parse and print by-reference parameters of callable types by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13290](https://github.com/vimeo/psalm/pull/13290) - fix(and): a variable assigned in the right operand of && may keep its earlier type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13361](https://github.com/vimeo/psalm/pull/13361) - fix(closures): the self of a closure parameter called in a trait is the using class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13301](https://github.com/vimeo/psalm/pull/13301) - ctype checks of an expression of the implied type are not redundant ([#&#8203;12431](https://github.com/vimeo/psalm/issues/12431)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12748](https://github.com/vimeo/psalm/pull/12748) - fix(psalter): don't remove the others when fixing an unused property by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12840](https://github.com/vimeo/psalm/pull/12840) - fix(stubs): exec() output is list<string> for an empty array by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12844](https://github.com/vimeo/psalm/pull/12844) - fix(types): cases() on a bare enum-string is a call on UnitEnum by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12908](https://github.com/vimeo/psalm/pull/12908) - feat(array_intersect_key): limit the result keys to the keys of sealed shapes by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12774](https://github.com/vimeo/psalm/pull/12774) - fix(types): expand the type of an [@&#8203;property](https://github.com/property) when narrowing it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12931](https://github.com/vimeo/psalm/pull/12931) - fix(algebra): equal in-array clauses of different arrays are not a repetition by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12891](https://github.com/vimeo/psalm/pull/12891) - fix(loops): no stale narrowing of properties in do-while conditions by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12863](https://github.com/vimeo/psalm/pull/12863) - fix(callable): a first-class callable of a method keeps the return type it inherits by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13108](https://github.com/vimeo/psalm/pull/13108) - fix(purity): signal the implicit \_\_toString call of an argument whatever the analysis mode by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13105](https://github.com/vimeo/psalm/pull/13105) - feat(type-alias): report an imported type alias named like an existing class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13109](https://github.com/vimeo/psalm/pull/13109) - fix(unused): count the value of a pre-increment used as an array key by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13168](https://github.com/vimeo/psalm/pull/13168) - fix(docblock): the docblock before a use statement still declares the variables of the file by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13076](https://github.com/vimeo/psalm/pull/13076) - fix(callable): do not accept a callable that requires an optional parameter by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13128](https://github.com/vimeo/psalm/pull/13128) - fix(reconciler): remove null from the bound of a template on isset by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12954](https://github.com/vimeo/psalm/pull/12954) - fix(types): combine the types left by negating is_string/is_array by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12890](https://github.com/vimeo/psalm/pull/12890) - Infer array_filter() of an array or mixed like array_filter() of mixed by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12731](https://github.com/vimeo/psalm/pull/12731) - fix(classes): analyse an anonymous class only once at a time by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13115](https://github.com/vimeo/psalm/pull/13115) - fix(assert): assert an object shape on a plain object by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13217](https://github.com/vimeo/psalm/pull/13217) - fix(scanner): give a constant defined in several branches the union of its values by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13222](https://github.com/vimeo/psalm/pull/13222) - fix(docblock): accept a [@&#8203;psalm-check-type](https://github.com/psalm-check-type) spanning several docblock lines by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13227](https://github.com/vimeo/psalm/pull/13227) - fix(reconciler): narrow with an instanceof result stored in a variable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13221](https://github.com/vimeo/psalm/pull/13221) - Fix taint lost on method calls whose return type a plugin provides by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13552](https://github.com/vimeo/psalm/pull/13552) - Fix conditional return type treating a \_\_toString object as a string by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13559](https://github.com/vimeo/psalm/pull/13559) - test(stubs): check stub function parameters against the call map by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12632](https://github.com/vimeo/psalm/pull/12632) - Report array_unique() of objects that can't be converted to strings by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12628](https://github.com/vimeo/psalm/pull/12628) - test(loop): an if that breaks keeps what its condition assigns ([#&#8203;10727](https://github.com/vimeo/psalm/issues/10727)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13324](https://github.com/vimeo/psalm/pull/13324) - fix(types): a class with pseudo properties satisfies an object shape by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12977](https://github.com/vimeo/psalm/pull/12977) - fix(stubs): the stubs generator leaves out the type of a scalar by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13190](https://github.com/vimeo/psalm/pull/13190) - fix(assertions): accept an object shape as the argument of an assertion about one of its properties [#&#8203;11386](https://github.com/vimeo/psalm/issues/11386) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13278](https://github.com/vimeo/psalm/pull/13278) - fix(constants): narrow static::CONSTANT separately from self::CONSTANT [#&#8203;10058](https://github.com/vimeo/psalm/issues/10058) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13282](https://github.com/vimeo/psalm/pull/13282) - fix(properties): [@&#8203;psalm-suppress](https://github.com/psalm-suppress) in the docblock of a promoted property applies to the property by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13371](https://github.com/vimeo/psalm/pull/13371) - fix(interfaces): isset() of a property of an interface is not an interface property access by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13368](https://github.com/vimeo/psalm/pull/13368) - fix(reconciler): an assertion with alternatives is impossible only when all of them are by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13367](https://github.com/vimeo/psalm/pull/13367) - Remove an enum from the type where it is not instanceof itself by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13327](https://github.com/vimeo/psalm/pull/13327) - feat(config): add assumeGettersMutationFree to stop taking unannotated getters as mutation-free by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13351](https://github.com/vimeo/psalm/pull/13351) - fix(global): do not report InvalidGlobal in a file that documents its $this [#&#8203;9773](https://github.com/vimeo/psalm/issues/9773) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13285](https://github.com/vimeo/psalm/pull/13285) - fix(properties): $this is static in the pass that collects what a constructor initializes by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13373](https://github.com/vimeo/psalm/pull/13373) - fix(config): MutableDependency and ImmutableDependency are class issues, suppressible per referenced class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13380](https://github.com/vimeo/psalm/pull/13380) - fix(is_a): keep the template of a class-string<T> narrowed by is_a/is_subclass_of by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13393](https://github.com/vimeo/psalm/pull/13393) - docs(InvalidGlobal): say what global does in the global scope and show the allowed use by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13405](https://github.com/vimeo/psalm/pull/13405) - fix(match): a match with more arms than the maximum shaped array size can be exhaustive by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13382](https://github.com/vimeo/psalm/pull/13382) - fix(closure): a closure returned from a closure takes its types from that closure by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13398](https://github.com/vimeo/psalm/pull/13398) - fix(templates): class template bound by the receiver keeps invariance for method params by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13428](https://github.com/vimeo/psalm/pull/13428) - fix(config): include ParseError in the list of issue types by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13419](https://github.com/vimeo/psalm/pull/13419) - The true branch of a conditional type bounds the template by its condition ([#&#8203;11867](https://github.com/vimeo/psalm/issues/11867)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12769](https://github.com/vimeo/psalm/pull/12769) - Narrow the receiver of a nullsafe property compared to null by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13314](https://github.com/vimeo/psalm/pull/13314) - fix(constants): a negated defined() check no longer switches the undefined constant check off by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13096](https://github.com/vimeo/psalm/pull/13096) - fix(config): only the CLI entry points read the arguments of the process by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12815](https://github.com/vimeo/psalm/pull/12815) - fix(arguments): a parameter another unpacked array names is not mixed by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12849](https://github.com/vimeo/psalm/pull/12849) - fix(reconciler): do not re-report keys nested in an assigned variable in a conjunction by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13119](https://github.com/vimeo/psalm/pull/13119) - fix(types): combining numeric-string with the empty string twice must not widen to string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12903](https://github.com/vimeo/psalm/pull/12903) - fix(array-functions): array_pop and array_shift adjust an array element too by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13111](https://github.com/vimeo/psalm/pull/13111) - fix(switch): report a case of switch(true) that cannot match by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12926](https://github.com/vimeo/psalm/pull/12926) - fix(mixed): do not report MixedAssignment of a variable narrowed by an elseif condition by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13174](https://github.com/vimeo/psalm/pull/13174) - DateTimeImmutable::createFromFormat() honours ignoreInternalFunctionFalseReturn by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12620](https://github.com/vimeo/psalm/pull/12620) - fix(array_map): a variadic callback or one using func_get_args() takes any number of arrays by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13370](https://github.com/vimeo/psalm/pull/13370) - Fix: Stub generation for union types that result to scalar could not be converted to identifier by [@&#8203;Mirco91](https://github.com/Mirco91) in [#&#8203;11852](https://github.com/vimeo/psalm/pull/11852) - Fix taint lost into an override's parameter through a call of the parent's variadic by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13556](https://github.com/vimeo/psalm/pull/13556) - Fix conditional on a class matching a string-bounded class template by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13561](https://github.com/vimeo/psalm/pull/13561) - Keep string|int|float|bool unions in generated stubs (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13565](https://github.com/vimeo/psalm/pull/13565) - fix(alter): keep an assignment whose value is stored into an array element by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13420](https://github.com/vimeo/psalm/pull/13420) - fix(templates): a type predicate on a template bounded by another template looks through its bound by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13299](https://github.com/vimeo/psalm/pull/13299) - fix(templates): a template nested in a generic param is inferred, not compared invariantly by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13431](https://github.com/vimeo/psalm/pull/13431) - test(template): pin a conditional return making a template array non-empty by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13342](https://github.com/vimeo/psalm/pull/13342) - fix(types): read the escape sequences of a string literal in a docblock type as PHP does by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13402](https://github.com/vimeo/psalm/pull/13402) - fix(include): an included file can't change the type of $this by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13423](https://github.com/vimeo/psalm/pull/13423) - fix(closures): a narrowed property of an immutable object is known in an arrow function by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13381](https://github.com/vimeo/psalm/pull/13381) - fix(types): keep truthiness when narrowing non-empty-mixed by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12843](https://github.com/vimeo/psalm/pull/12843) - Type get_object_vars() with array-key keys by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12627](https://github.com/vimeo/psalm/pull/12627) - Leave out stub signature types with a scalar PHP can't spell by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13570](https://github.com/vimeo/psalm/pull/13570) - Report a misplaced variable in a promoted property docblock as an issue, not a crash (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13571](https://github.com/vimeo/psalm/pull/13571) - Fix crash on a property assertion about a non-variable argument (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13572](https://github.com/vimeo/psalm/pull/13572) - Report a TypeParseTreeException in a [@&#8203;mixin](https://github.com/mixin) / [@&#8203;psalm-require-](https://github.com/psalm-require-)\* type as an issue, not a crash (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13573](https://github.com/vimeo/psalm/pull/13573) - Accept a name after the = or ... of a callable param (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13574](https://github.com/vimeo/psalm/pull/13574) - Fix crash on first-class callables in count()/gettype()/get_class() conditions (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13575](https://github.com/vimeo/psalm/pull/13575) - Fix cache reads crashing while another worker rewrites the entry (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13576](https://github.com/vimeo/psalm/pull/13576) - Fix warm-cache crash when a file is reached under two spellings of its path (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13577](https://github.com/vimeo/psalm/pull/13577) - Fix crash when a class is named only in a template's bound (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13579](https://github.com/vimeo/psalm/pull/13579) - Don't crash on a constant dividing by a zero constant of another class (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13580](https://github.com/vimeo/psalm/pull/13580) - Don't fold a shift by a negative number or zero to a negative power (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13582](https://github.com/vimeo/psalm/pull/13582) - Don't overflow the int range bound in a comparison with PHP_INT_MAX or PHP_INT_MIN (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13583](https://github.com/vimeo/psalm/pull/13583) - Fix crash when scope summaries contain non-UTF-8 strings (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13585](https://github.com/vimeo/psalm/pull/13585) - Fix crash on array_multisort() flags when Psalm runs on PHP 8.6 (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13586](https://github.com/vimeo/psalm/pull/13586) - Don't crash psalter on properties declared together (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13587](https://github.com/vimeo/psalm/pull/13587) - feat(docblock): choose between the [@&#8203;method](https://github.com/method) overloads of a magic method by the arguments by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13352](https://github.com/vimeo/psalm/pull/13352) - Give array_reduce() callbacks the type of the array elements by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12610](https://github.com/vimeo/psalm/pull/12610) - fix(inheritance): an override is compared with the docblock a method inherits from its interface by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13446](https://github.com/vimeo/psalm/pull/13446) - fix(args): an unpacked argument passes only the parameters it has values for by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12671](https://github.com/vimeo/psalm/pull/12671) - Narrow the variable of a ??= condition ([#&#8203;11158](https://github.com/vimeo/psalm/issues/11158)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12743](https://github.com/vimeo/psalm/pull/12743) - fix(traits): a trait method without docblock inherits the docblock of the parent method by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13440](https://github.com/vimeo/psalm/pull/13440) - fix(if-else): know the variables assigned in an || condition in the else branch and ternary else by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12665](https://github.com/vimeo/psalm/pull/12665) - refactor(assertions): handle an asserted argument's property and the rules' class constants in one place by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13510](https://github.com/vimeo/psalm/pull/13510) - fix(type-parser): keep an optional shape key named like a scalar alias, self or parent by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12682](https://github.com/vimeo/psalm/pull/12682) - fix(types): an interpolated string with a non-falsy part is non-falsy by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12869](https://github.com/vimeo/psalm/pull/12869) - feat(array_merge_recursive): keep the shape of arrays that share no key by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13399](https://github.com/vimeo/psalm/pull/13399) - Accept a name before the = of a callable param (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13578](https://github.com/vimeo/psalm/pull/13578) - fix(unused): don't report a [@&#8203;phpstan-var](https://github.com/phpstan-var) as an unnecessary [@&#8203;var](https://github.com/var) annotation by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13092](https://github.com/vimeo/psalm/pull/13092) - Fix crash of multi-threaded runs without posix (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13581](https://github.com/vimeo/psalm/pull/13581) - Fix crashes on `NAN`, `INF` and out-of-range float literals on PHP 8.5+ (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13584](https://github.com/vimeo/psalm/pull/13584) - Accept memcached as a supported extension, as config.xsd and the stub say (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13588](https://github.com/vimeo/psalm/pull/13588) - fix(unused-code): a dynamic class constant name on an expression is used by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12880](https://github.com/vimeo/psalm/pull/12880) - fix(arrays): assigning to the item of an array a function returns by reference has an effect by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13195](https://github.com/vimeo/psalm/pull/13195) - fix(types): resolve type variables read by foreach, destructuring and clone by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12861](https://github.com/vimeo/psalm/pull/12861) - fix(analysis): an undefined static property given to an unknown callee is reported by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12929](https://github.com/vimeo/psalm/pull/12929) - fix(unused-code): params of a method are used when the variables cannot be checked by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12780](https://github.com/vimeo/psalm/pull/12780) - fix(constants): a final constant fetched on an instance has its declared type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12688](https://github.com/vimeo/psalm/pull/12688) - fix(constants): expand the declared type of a class constant before checking its value by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12649](https://github.com/vimeo/psalm/pull/12649) - fix(templates): map an object's extended params through the inheritance chain by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12777](https://github.com/vimeo/psalm/pull/12777) - Don't report arithmetic on a template bounded by int|float as mixed by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12606](https://github.com/vimeo/psalm/pull/12606) - fix(enum): use the value of an annotated constant as an enum case value by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13171](https://github.com/vimeo/psalm/pull/13171) - Don't report a shebang line as unevaluated after a namespaced exit or return by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12695](https://github.com/vimeo/psalm/pull/12695) - fix(docblocks): analyse the docblock of a use statement [#&#8203;6065](https://github.com/vimeo/psalm/issues/6065) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13279](https://github.com/vimeo/psalm/pull/13279) - \[6.x] Fix: crash on count()/gettype()/get_class() conditions with php-parser < 5.9 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13594](https://github.com/vimeo/psalm/pull/13594) - \[6.x] Infer the offsetGet type when destructuring a non-Traversable ArrayAccess by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13595](https://github.com/vimeo/psalm/pull/13595) - fix(do-while): do not report NoValue for code only impossible in the first iteration by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12679](https://github.com/vimeo/psalm/pull/12679) - fix(language-server): omit unset optional fields instead of sending null by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12811](https://github.com/vimeo/psalm/pull/12811) - fix(try): the variables of every catch count when the try always exits by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12916](https://github.com/vimeo/psalm/pull/12916) - Count a variable referenced by a property or array item as used by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12693](https://github.com/vimeo/psalm/pull/12693) - fix(array_map): keep the list/keys of an array arg whose type is a template by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13430](https://github.com/vimeo/psalm/pull/13430) - fix(template): a literal returned where a template variable is identical to it is a T by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13294](https://github.com/vimeo/psalm/pull/13294) - fix(filter_var): accept both values of FILTER_FLAG_GLOBAL_RANGE by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12784](https://github.com/vimeo/psalm/pull/12784) - fix(return-types): expand the implementer's docblock return type like the inherited one by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12779](https://github.com/vimeo/psalm/pull/12779) - Expand the signature of a method's closure like a function's ([#&#8203;12388](https://github.com/vimeo/psalm/issues/12388)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12758](https://github.com/vimeo/psalm/pull/12758) - Don't fold arithmetic on array items and properties in loops like literals ([#&#8203;7250](https://github.com/vimeo/psalm/issues/7250)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12770](https://github.com/vimeo/psalm/pull/12770) - Keep a file_exists guard of an include across && and for constants by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13322](https://github.com/vimeo/psalm/pull/13322) - fix(taint): don't loop on files requiring each other by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13415](https://github.com/vimeo/psalm/pull/13415) - fix(unused-code): a variable variable may read any variable of the scope by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12781](https://github.com/vimeo/psalm/pull/12781) - fix(taint): a nullsafe call on a property acts on the property itself by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12808](https://github.com/vimeo/psalm/pull/12808) - fix(types): accept an imported type alias in key-of and value-of by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12806](https://github.com/vimeo/psalm/pull/12806) - Infer a non-falsy string for implode() of a non-falsy piece or separator by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12596](https://github.com/vimeo/psalm/pull/12596) - fix(interfaces): assigning a property of an interface that isset() found is not an interface property access by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13379](https://github.com/vimeo/psalm/pull/13379) - fix(control-flow): a loop that nothing leaves ends the function by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12846](https://github.com/vimeo/psalm/pull/12846) - An assertion on an item with a union key keeps the other items as they are ([#&#8203;11845](https://github.com/vimeo/psalm/issues/11845)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12765](https://github.com/vimeo/psalm/pull/12765) - fix(constants): don't keep the literal of a class constant read through self/static in a trait by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13223](https://github.com/vimeo/psalm/pull/13223) - fix(types): compare array shapes key by key when checking if they can be identical by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12654](https://github.com/vimeo/psalm/pull/12654) - Follow a method of a parent class or trait when checking what a constructor sets by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12619](https://github.com/vimeo/psalm/pull/12619) - fix(call): the templates of a method are bound by its arguments, not read as bindings of its class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13447](https://github.com/vimeo/psalm/pull/13447) - Fix: infer templates from a generic array in a union with null or false by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13598](https://github.com/vimeo/psalm/pull/13598) - fix(if): what is known of an offset of a variable a branch assigns is forgotten after the if by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13375](https://github.com/vimeo/psalm/pull/13375) - Fix: MethodSignatureMismatch repeated on every subclass for an inherited [@&#8203;method](https://github.com/method) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13600](https://github.com/vimeo/psalm/pull/13600) ##### Internal changes - Show raw issue changes in the perf report headline by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13567](https://github.com/vimeo/psalm/pull/13567) - Let the BC check accept the growing list of stubbed extensions (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13590](https://github.com/vimeo/psalm/pull/13590) - Merge 6.x into master by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13597](https://github.com/vimeo/psalm/pull/13597) - Perf: keep statements of inlined constructor callees with arrayCache on (-5 to -7 % CPU) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13589](https://github.com/vimeo/psalm/pull/13589) ##### Other changes - fix(closure): keep what a closure writes to a by-reference variable before it returns by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13177](https://github.com/vimeo/psalm/pull/13177) - fix(mixin): forward a static call to the mixin that has the method by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13202](https://github.com/vimeo/psalm/pull/13202) #### New Contributors - [@&#8203;1cbyc](https://github.com/1cbyc) made their first contribution in [#&#8203;13472](https://github.com/vimeo/psalm/pull/13472) - [@&#8203;Mirco91](https://github.com/Mirco91) made their first contribution in [#&#8203;11852](https://github.com/vimeo/psalm/pull/11852) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.3.0...7.3.1> </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. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTcuOSIsInVwZGF0ZWRJblZlciI6IjQ1LjYuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwiZG9ja2VyIiwiZml4IiwibWlub3IiLCJwaHAiXX0=-->
fix(deps): update all non-major dependencies
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
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 / markdown (push) Has been cancelled
CI / server (32) (push) Has been cancelled
CI / server (35) (push) Has been cancelled
CI / talk-api (push) Has been cancelled
CI / golden (push) Has been cancelled
CI / voice (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 / markdown (pull_request) Has been cancelled
CI / server (32) (pull_request) Has been cancelled
CI / server (35) (pull_request) Has been cancelled
CI / talk-api (pull_request) Has been cancelled
CI / golden (pull_request) Has been cancelled
CI / voice (pull_request) Has been cancelled
regenerate-bot the build failed (failure)
292edd0fc9
renovate-bot force-pushed renovate/all-minor-patch from 292edd0fc9
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
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 / markdown (push) Has been cancelled
CI / server (32) (push) Has been cancelled
CI / server (35) (push) Has been cancelled
CI / talk-api (push) Has been cancelled
CI / golden (push) Has been cancelled
CI / voice (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 / markdown (pull_request) Has been cancelled
CI / server (32) (pull_request) Has been cancelled
CI / server (35) (pull_request) Has been cancelled
CI / talk-api (pull_request) Has been cancelled
CI / golden (pull_request) Has been cancelled
CI / voice (pull_request) Has been cancelled
regenerate-bot the build failed (failure)
to 41de9a64ae
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI / php (dev-stable32) (push) Failing after 1m23s
CI / php (dev-master) (push) Successful in 1m45s
CI / php (dev-stable35) (push) Failing after 24s
CI / php (dev-stable34) (push) Failing after 12s
CI / php (dev-stable33) (push) Successful in 1m45s
CI / standards (push) Failing after 45s
CI / talk-api (push) Successful in 50s
CI / markdown (push) Successful in 35s
CI / php (dev-master) (pull_request) Failing after 6s
CI / server (32) (push) Successful in 2s
CI / php (dev-stable32) (pull_request) Successful in 1m45s
CI / voice (push) Failing after 24s
CI / server (35) (push) Successful in 3s
CI / golden (push) Successful in 6m5s
CI / php (dev-stable33) (pull_request) Successful in 1m46s
CI / php (dev-stable34) (pull_request) Successful in 1m49s
CI / markdown (pull_request) Successful in 41s
CI / standards (pull_request) Failing after 2m14s
CI / server (35) (pull_request) Successful in 2s
CI / php (dev-stable35) (pull_request) Successful in 1m50s
CI / server (32) (pull_request) Successful in 2s
CI / voice (pull_request) Failing after 25s
CI / talk-api (pull_request) Successful in 56s
CI / golden (pull_request) Successful in 6m17s
regenerate-bot the generated files are up to date
2026-11-30 03:43:57 +00:00
Compare

Tests of CI / php (dev-master): passed

266 passed, 0 failed, 0 skipped (266 tests, 11.5 s)

Of 3c1eecb682, the run, updated by every run.

<!-- ci-report tests: CI-php-dev-master- --> ### Tests of CI / php (dev-master): passed **266 passed, 0 failed, 0 skipped** (266 tests, 11.5 s) <sub>Of 3c1eecb682, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-ai/actions/runs/212), updated by every run.</sub>

Tests of CI / php (dev-stable32): passed

266 passed, 0 failed, 0 skipped (266 tests, 11.1 s)

Of 3c1eecb682, the run, updated by every run.

<!-- ci-report tests: CI-php-dev-stable32- --> ### Tests of CI / php (dev-stable32): passed **266 passed, 0 failed, 0 skipped** (266 tests, 11.1 s) <sub>Of 3c1eecb682, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-ai/actions/runs/212), updated by every run.</sub>

Tests of CI / php (dev-stable33): passed

266 passed, 0 failed, 0 skipped (266 tests, 11.0 s)

Of 3c1eecb682, the run, updated by every run.

<!-- ci-report tests: CI-php-dev-stable33- --> ### Tests of CI / php (dev-stable33): passed **266 passed, 0 failed, 0 skipped** (266 tests, 11.0 s) <sub>Of 3c1eecb682, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-ai/actions/runs/212), updated by every run.</sub>

Tests of CI / php (dev-stable34): passed

266 passed, 0 failed, 0 skipped (266 tests, 11.2 s)

Of 3c1eecb682, the run, updated by every run.

<!-- ci-report tests: CI-php-dev-stable34- --> ### Tests of CI / php (dev-stable34): passed **266 passed, 0 failed, 0 skipped** (266 tests, 11.2 s) <sub>Of 3c1eecb682, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-ai/actions/runs/212), updated by every run.</sub>

Tests of CI / php (dev-stable35): passed

266 passed, 0 failed, 0 skipped (266 tests, 10.9 s)

Of 3c1eecb682, the run, updated by every run.

<!-- ci-report tests: CI-php-dev-stable35- --> ### Tests of CI / php (dev-stable35): passed **266 passed, 0 failed, 0 skipped** (266 tests, 10.9 s) <sub>Of 3c1eecb682, [the run](https://git.ciepiela.org/dawid/nextcloud-talk-ai/actions/runs/212), updated by every run.</sub>
renovate-bot force-pushed renovate/all-minor-patch from 41de9a64ae
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI / php (dev-stable32) (push) Failing after 1m23s
CI / php (dev-master) (push) Successful in 1m45s
CI / php (dev-stable35) (push) Failing after 24s
CI / php (dev-stable34) (push) Failing after 12s
CI / php (dev-stable33) (push) Successful in 1m45s
CI / standards (push) Failing after 45s
CI / talk-api (push) Successful in 50s
CI / markdown (push) Successful in 35s
CI / php (dev-master) (pull_request) Failing after 6s
CI / server (32) (push) Successful in 2s
CI / php (dev-stable32) (pull_request) Successful in 1m45s
CI / voice (push) Failing after 24s
CI / server (35) (push) Successful in 3s
CI / golden (push) Successful in 6m5s
CI / php (dev-stable33) (pull_request) Successful in 1m46s
CI / php (dev-stable34) (pull_request) Successful in 1m49s
CI / markdown (pull_request) Successful in 41s
CI / standards (pull_request) Failing after 2m14s
CI / server (35) (pull_request) Successful in 2s
CI / php (dev-stable35) (pull_request) Successful in 1m50s
CI / server (32) (pull_request) Successful in 2s
CI / voice (pull_request) Failing after 25s
CI / talk-api (pull_request) Successful in 56s
CI / golden (pull_request) Successful in 6m17s
regenerate-bot the generated files are up to date
to 3c1eecb682
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI / php (dev-master) (push) Successful in 1m48s
CI / php (dev-stable32) (push) Successful in 1m49s
CI / php (dev-stable33) (push) Successful in 1m44s
CI / php (dev-stable34) (push) Successful in 1m45s
CI / php (dev-stable35) (push) Successful in 1m46s
CI / markdown (push) Successful in 37s
CI / server (32) (push) Successful in 2s
CI / server (35) (push) Successful in 2s
CI / standards (push) Failing after 2m16s
CI / talk-api (push) Successful in 45s
CI / voice (push) Failing after 25s
CI / php (dev-master) (pull_request) Successful in 1m49s
CI / php (dev-stable32) (pull_request) Successful in 1m48s
CI / php (dev-stable33) (pull_request) Successful in 1m54s
CI / golden (push) Successful in 6m16s
CI / server (32) (pull_request) Successful in 2s
CI / php (dev-stable34) (pull_request) Successful in 1m47s
CI / markdown (pull_request) Successful in 42s
CI / server (35) (pull_request) Successful in 2s
CI / php (dev-stable35) (pull_request) Successful in 1m48s
CI / talk-api (pull_request) Successful in 43s
CI / standards (pull_request) Failing after 2m18s
CI / voice (pull_request) Failing after 25s
regenerate-bot the generated files are up to date
CI / golden (pull_request) Successful in 6m15s
2026-12-02 21:23:37 +00:00
Compare
renovate-bot force-pushed renovate/all-minor-patch from 3c1eecb682
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI / php (dev-master) (push) Successful in 1m48s
CI / php (dev-stable32) (push) Successful in 1m49s
CI / php (dev-stable33) (push) Successful in 1m44s
CI / php (dev-stable34) (push) Successful in 1m45s
CI / php (dev-stable35) (push) Successful in 1m46s
CI / markdown (push) Successful in 37s
CI / server (32) (push) Successful in 2s
CI / server (35) (push) Successful in 2s
CI / standards (push) Failing after 2m16s
CI / talk-api (push) Successful in 45s
CI / voice (push) Failing after 25s
CI / php (dev-master) (pull_request) Successful in 1m49s
CI / php (dev-stable32) (pull_request) Successful in 1m48s
CI / php (dev-stable33) (pull_request) Successful in 1m54s
CI / golden (push) Successful in 6m16s
CI / server (32) (pull_request) Successful in 2s
CI / php (dev-stable34) (pull_request) Successful in 1m47s
CI / markdown (pull_request) Successful in 42s
CI / server (35) (pull_request) Successful in 2s
CI / php (dev-stable35) (pull_request) Successful in 1m48s
CI / talk-api (pull_request) Successful in 43s
CI / standards (pull_request) Failing after 2m18s
CI / voice (pull_request) Failing after 25s
regenerate-bot the generated files are up to date
CI / golden (pull_request) Successful in 6m15s
to 6bb68adc01
Some checks are pending
CI / php (dev-master) (pull_request) Waiting to run
CI / php (dev-stable32) (pull_request) Waiting to run
CI / php (dev-stable33) (pull_request) Waiting to run
CI / php (dev-stable34) (pull_request) Waiting to run
CI / php (dev-stable35) (pull_request) Waiting to run
CI / standards (pull_request) Waiting to run
CI / markdown (pull_request) Waiting to run
CI / server (32) (pull_request) Waiting to run
CI / server (35) (pull_request) Waiting to run
CI / talk-api (pull_request) Waiting to run
CI / golden (pull_request) Waiting to run
CI / voice (pull_request) Waiting to run
CI / php (dev-master) (push) Waiting to run
CI / php (dev-stable32) (push) Waiting to run
CI / php (dev-stable33) (push) Waiting to run
CI / php (dev-stable34) (push) Waiting to run
CI / php (dev-stable35) (push) Waiting to run
CI / standards (push) Waiting to run
CI / markdown (push) Waiting to run
CI / server (32) (push) Waiting to run
CI / server (35) (push) Waiting to run
CI / talk-api (push) Waiting to run
CI / golden (push) Waiting to run
CI / voice (push) Waiting to run
renovate/stability-days Updates have met minimum release age requirement
regenerate-bot regenerating
2026-12-04 06:23:42 +00:00
Compare
Some checks are pending
CI / php (dev-master) (pull_request) Waiting to run
CI / php (dev-stable32) (pull_request) Waiting to run
CI / php (dev-stable33) (pull_request) Waiting to run
CI / php (dev-stable34) (pull_request) Waiting to run
CI / php (dev-stable35) (pull_request) Waiting to run
CI / standards (pull_request) Waiting to run
CI / markdown (pull_request) Waiting to run
CI / server (32) (pull_request) Waiting to run
CI / server (35) (pull_request) Waiting to run
CI / talk-api (pull_request) Waiting to run
CI / golden (pull_request) Waiting to run
CI / voice (pull_request) Waiting to run
CI / php (dev-master) (push) Waiting to run
CI / php (dev-stable32) (push) Waiting to run
CI / php (dev-stable33) (push) Waiting to run
CI / php (dev-stable34) (push) Waiting to run
CI / php (dev-stable35) (push) Waiting to run
CI / standards (push) Waiting to run
CI / markdown (push) Waiting to run
CI / server (32) (push) Waiting to run
CI / server (35) (push) Waiting to run
CI / talk-api (push) Waiting to run
CI / golden (push) Waiting to run
CI / voice (push) Waiting to run
renovate/stability-days Updates have met minimum release age requirement
regenerate-bot regenerating
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'renovate/all-minor-patch:renovate/all-minor-patch'
git switch 'renovate/all-minor-patch'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'renovate/all-minor-patch'
git switch 'renovate/all-minor-patch'
git rebase 'main'
git switch 'main'
git merge --ff-only 'renovate/all-minor-patch'
git switch 'renovate/all-minor-patch'
git rebase 'main'
git switch 'main'
git merge --no-ff 'renovate/all-minor-patch'
git switch 'main'
git merge --squash 'renovate/all-minor-patch'
git switch 'main'
git merge --ff-only 'renovate/all-minor-patch'
git switch 'main'
git merge 'renovate/all-minor-patch'
git push origin 'main'
Sign in to join this conversation.
No description provided.