Update dependency vimeo/psalm to v7 #23

Open
renovate-bot wants to merge 1 commit from renovate/vimeo-psalm-7.x into main
Collaborator

This PR contains the following updates:

Package Change Age Confidence
vimeo/psalm ^5.23 → ^7.0 age confidence

Release Notes

vimeo/psalm

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

v7.3.0

Compare Source

What's Changed

Features
Fixes
Internal changes
  • Perf: Avoid quadratic copying when closing dependent classlikes in Populator (~2.5% faster on a big app) by @​alies-dev in #​13508
  • chore(baseline): drop the ImplicitToStringCast entry that #​11798 made unused by @​jirkace in #​13507
  • Fix PHPUnit plugin diagnostics in self-analysis by @​orklah in #​13524
  • Perf: Skip building code use edges that are not recorded when consolidating analysed data (~2% faster on a big app) by @​alies-dev in #​13509
Other changes

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

v7.2.1

Compare Source

What's Changed

Fixes
Docs
Internal changes
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.2.0...7.2.1

v7.2.0

Compare Source

What's Changed

Features
Fixes
Docs
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.1.0...7.2.0

v7.1.0

Compare Source

What's Changed

Features
Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.0.5...7.1.0

v7.0.5

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.0.4...7.0.5

v7.0.4

Compare Source

What's Changed

Fixes
Internal changes
  • Perf: speed up warm runs and the consolidated cache with one file per cache entry by @​alies-dev in #​13249

Full Changelog: https://github.com/vimeo/psalm/compare/7.0.3...7.0.4

v7.0.3

Compare Source

What's Changed

Fixes
Docs
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.0.2...7.0.3

v7.0.2

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/7.0.1...7.0.2

v7.0.1

Compare Source

What's Changed

Fixes
Docs
Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/7.0.0...7.0.1

v7.0.0: Psalm 7

Compare Source

Psalm 7

Announcing the release of Psalm 7!

Featuring a simply enormous number of new features and bug fixes, such as:

  • security analysis on by default: fully refactored for 10x+ performance and much greater coverage, in the same run as type checking and dead code detection;
  • much deeper security analysis taint tracking: NoSQL, LLM prompt and URL injection, new sources like php://input and uploaded file names, flows through closures, generators, traits and by-reference parameters, and ready-made stubs for Guzzle, PSR-7, Monolog, MongoDB and more.
  • a new purity model based on Hack's capabilities: declare exactly which side effects a function may have (io, time, write-props...), with purity templates for classes, closures and automatically inferred annotations;
  • graph-based dead code detection: If nothing reachable uses a class, function, method, constant, variable, etc, Psalm finds it, now properly handling unused cycles as well.
  • Template defaults (@template TError of Throwable = RuntimeException) for classes, functions and methods: Result<int> just works, and libraries can add templates without breaking their users.
  • PHP 8.5 and 8.6 support: Full support for Partial Function Application, the pipe operator, and much more!
  • Daily releases. Features and fixes reach you the day they land, no more waiting on dev-master.
  • Framework plugins in the box. The PHPUnit, Symfony, Laravel, Mockery and sabre/event plugins ship with Psalm and switch on by themselves. Zero setup.
  • a bigger Psalm maintainer team: @​alies-dev has joined the Psalm maintainer team, contributing many new useful features and bugfixes!
  • An official Discord community!
  • And so, so many other new features and bugfixes!

Psalm 7 runs on 64-bit PHP 8.2 to 8.6. Upgrading is simple for most projects: see Upgrading below.

Security analysis: faster, always on, in a single run

Taints are now stored as a bitmask, and the taint graph is resolved over compact summaries of each function. This makes security analysis up to 10x faster.

Combined analysis (#​11384) runs type checking, security analysis and dead code detection together in one run, so taint analysis is now on by default (#​11399).

Taint issues are reported with a SECURITY severity, and with a rank in SARIF reports (#​12068, #​11383). The results no longer change between runs or with the thread count (#​11946, #​11952, #​11953).

Deeper taint tracking

<?php
$run = function (string $c): void {
    shell_exec($c);
};
$run((string) $_GET['cmd']); // TaintedShell, through the closure

$mongo = new MongoDB\Driver\Manager('mongodb://localhost');
$mongo->executeQuery('db.users', new MongoDB\Driver\Query(['name' => $_GET['name']])); // TaintedNosql

/** @return mixed */
function body() {
    return json_decode((string) file_get_contents('php://input'), true);
}
eval((string) body()); // TaintedEval: php://input is a source

Try it on psalm.dev »

A new purity model: capabilities

@psalm-pure, @psalm-mutation-free and @psalm-external-mutation-free are replaced by capabilities, modelled on Hack's contexts and capabilities. A function-like declares exactly which side effects it may have: read-props, write-this-props, write-props, read-globals, write-globals, write-refs, io and time, with pure and impure at the two ends (#​11984):

<?php
/** @psalm-capabilities time */
function today(): string {
    return date('Y-m-d'); // no issue
}

/** @psalm-pure */
function todayWrong(): string {
    return date('Y-m-d'); // ImpureFunctionCall: ... requires time
}

Try it on psalm.dev »

  • Psalm infers purity across the call graph. Where an annotation could be added, it can suggest one: set <psalm suggestPurityAnnotations="true"> to get MissingPureAnnotation and MissingImmutableAnnotation (and their abstract and interface variants), and run --alter --issues=MissingPureAnnotation,MissingImmutableAnnotation to add the annotations. The --alter command works without the attribute. The suggestions are opt-in.
  • Pure and read-only functions are taint-specialized automatically, so annotating your code also removes false positives from security analysis.
  • Builtins, SPL, the Random, phpredis and MongoDB extensions and more declare what they do.
  • clone, __toString(), __invoke(), ArrayAccess, destructors, new $class and parameter defaults are now checked too.
  • @psalm-pure can be used on classes, and plugins can declare the capabilities of the methods they handle.

The new Purity Model article explains the model in full.

Purity templates

Many functions are only as pure as what they are given: array_map() is pure when its callback is. Purity templates are template parameters whose values are capability sets instead of types, like Hack's [ctx $f] contexts. A function can now be both pure and higher-order, and each call costs only what its arguments do (#​11984).

With Closure[_], a function takes its purity from the closure it is given:

<?php
/**
 * @psalm-pure
 * @param Closure[_](int): int $f
 */
function apply(Closure $f, int $x): int {
    return $f($x);
}

/** @psalm-pure */
function double(int $x): int {
    return apply(fn(int $y): int => $y * 2, $x); // no issue: the closure is pure
}

/** @psalm-pure */
function noisy(int $x): int {
    return apply(function (int $y): int { echo $y; return $y; }, $x); // ImpureFunctionCall: The context is pure but function call on apply requires io
}

/** @psalm-pure */
function lengths(array $words): array {
    return array_map(fn(string $w): int => strlen($w), $words); // no issue: builtins taking callbacks work the same way
}

On a class, a purity template lets each subclass decide what its methods may do:

<?php
/** @psalm-purity-template P */
abstract class Handler {
    /**
     * @psalm-pure
     * @psalm-purity-from-template P
     */
    abstract public function handle(string $input): string;
}

/** @extends Handler[pure] */
final class Upper extends Handler {
    /** @psalm-pure */
    #[Override]
    public function handle(string $input): string {
        return strtoupper($input);
    }
}

/** @extends Handler[io] */
final class Printer extends Handler {
    /** @psalm-capabilities io */
    #[Override]
    public function handle(string $input): string {
        echo $input;
        return $input;
    }
}

/** @psalm-pure */
function viaUpper(Upper $handler): string {
    return $handler->handle('a'); // no issue: Upper binds P to pure
}

/** @psalm-pure */
function viaPrinter(Printer $handler): string {
    return $handler->handle('a'); // ImpureMethodCall: The context is pure but method Printer::handle requires io
}

Traversable, Iterator, IteratorAggregate and Generator have a purity template, for what iterating over them does. iterable has one too. A generator with a purity annotation binds it to what its body does:

<?php
/**
 * @psalm-pure
 * @param Traversable[pure]<int, int> $xs
 */
function sum(Traversable $xs): int {
    $total = 0;
    foreach ($xs as $x) { // no issue
        $total += $x;
    }
    return $total;
}

/**
 * @psalm-pure
 * @param Traversable<int, int> $xs
 */
function sumAny(Traversable $xs): int {
    $total = 0;
    foreach ($xs as $x) { // ImpureMethodCall: The context is pure but iterating over Traversable<int, int> requires impure
        $total += $x;
    }
    return $total;
}

/**
 * @psalm-pure
 * @return Generator<int, int>
 */
function numbers(): Generator {
    yield 1;
    yield 2;
}

/** @psalm-pure */
function total(): int {
    return sum(numbers()); // no issue: numbers() returns a Generator[pure]
}
  • Syntax: purity arguments go in square brackets before the type arguments, as in Hack: Closure[io](int): void, Handler[pure], Iterator[pure]<int, string>, Box[io]<int>. Named templates are declared with @psalm-purity-template P and used with @psalm-purity-from-template P.
  • Bounds and defaults are written as a chain: @psalm-purity-template write-this-props <= C(write-this-props) <= write-this-props|write-props|io. A method may use the lower bound unconditionally. Subclasses must stay within the bounds, and get the default when they don't bind the template.
  • Constructors can bind a class template from their arguments, with a Closure[P] parameter or a conditional @return on __construct. For example, new ArrayObject([...]) is an ArrayObject[pure], so a pure function may fill an ArrayObject it created (#​12116, #​12179, #​12190).
  • Purity templates are checked across overrides, traits and closures nested in a templated scope (#​12015, #​12126, #​12027).
  • Inferred too: Psalm infers the purity of calls to templated functions, and --alter adds Closure[_] to the closure parameters a function calls (#​12077, #​12019).
  • Builtins and SPL taking callbacks or iterators are declared with purity templates: array_map, usort, preg_replace_callback, iterator_to_array, CallbackFilterIterator, Fiber and more (#​12122).

See Purity templates in the Purity Model article.

Graph-based dead code detection

Unused code is now found on a graph of references (#​11939). Code is used only if it can be reached from an entry point, so classes and methods referenced only by other unused code, cycles included, are reported. Exceptions that are created but never thrown are reported too (#​12487):

<?php
final class Service {
    public function run(int $id): void {
        if ($id < 0) {
            new InvalidArgumentException('negative id'); // UnusedMethodCall: ... never thrown or used
        }
        echo $id;
    }
}

final class Ping {                                     // UnusedClass
    public static function ping(): void { Pong::pong(); }
}

final class Pong {                                     // UnusedClass
    public static function pong(): void { Ping::ping(); }
}

(new Service())->run(1);

Try it on psalm.dev »

--find-unused-psalm-suppress now also checks suppressions on classes and on Tainted* issues.

Type system

  • Template defaults: a template can declare a default type, @template T = Default or @template T of Bound = Default, on classes, interfaces, traits, functions and methods. Psalm uses it when the type argument is left out: in @extends/@implements/@use, in a generic type with only its first arguments (Result<int>), in new, and in calls that don't infer the template. Libraries can add a template without breaking every Foo<A> their users wrote, and those users no longer get MissingTemplateParam. See Template defaults.

    <?php
    /**
     * @template TValue
     * @template TError of Throwable = RuntimeException
     */
    final class Result {
        /** @var TError|null */
        public ?Throwable $error = null;
    }
    
    /** @param Result<int> $result */
    function handle(Result $result): void {
        $error = $result->error; // RuntimeException|null (Psalm 6: MissingTemplateParam, Throwable|null)
    }
    
    /** @template T */
    interface Option {
        /**
         * @template TResult = T
         * @param (callable(T): TResult)|null $map
         * @return Option<TResult>
         */
        public function map(?callable $map = null): Option;
    }
    
    /** @param Option<int> $option */
    function check(Option $option): void {
        $same = $option->map(); // Option<int> (Psalm 6: Option<never>)
    }
    

    Try it on psalm.dev »

  • New types and syntax: decimal-int-string and non-decimal-int-string, global constant wildcards, conditional types on types that depend on a template, is not in conditional types, and exact intersections of scalar and conditional types.

  • Constructor @return types.

  • New IntMaskComparison issue for int-masks compared by value.

PHP 8.5 and 8.6

  • Psalm runs on PHP 8.6 and has a PHP 8.6 call map.

  • The PHP 8.5 pipe operator and PHP 8.6 partial function application are fully typed: Psalm infers the type of every pipeline stage and the signature of every partially applied closure, so a stage that doesn't fit the previous one is reported :

    <?php
    function slug(string $title): string {
        return $title
            |> trim(...)
            |> strtolower(...)
            |> str_replace(' ', '-', ?); // no issue: each stage is typed
    }
    
    function lowercaseWords(string $title): string {
        return $title |> explode(' ', ?) |> strtolower(...); // InvalidArgument: Argument 1 of strtolower expects string, but non-empty-list<string> provided
    }
    
    function wrongLength(string $title): string {
        return $title |> trim(...) |> strlen(...); // InvalidReturnStatement: 'int<0, max>' does not match 'string'
    }
    

    Try it on psalm.dev »

Plugins

  • Versioned plugin API: Psalm's version number no longer tracks the plugin API. Breaking changes to the plugin API may ship in any Psalm release, including minor and patch releases. The psalm/psalm-plugin-api metapackage tracks them instead (#​11739). Its major version is bumped for every breaking change, and its readme lists the changes. Plugins should require it with a caret range (^0.4): Composer will then only install the plugin with a Psalm release whose plugin API it was written for.
  • Bundled plugins: Psalm requires psalm/plugin-phpunit, plugin-mockery, plugin-symfony, plugin-laravel and plugin-sabre-event, and enables each one, plus the webmozart/assert plugin, when your composer.json uses the matching library (loadLibraryPlugins, on by default) (#​12568, #​12570, #​12571).
  • Plugin issues can have custom documentation URLs, and respect ERROR_LEVEL (#​11735, #​11736).

CLI and configuration

  • --init-ci generates a GitHub Actions workflow that runs the official Docker image, pinned to the Psalm version in your composer.lock. The docs now cover the Psalm GitHub Action and the Psalm Security Scan action, which sends security analysis results to GitHub code scanning.
  • The official Docker image is now ghcr.io/psalm/psalm.
  • The old compact output format is renamed table, and a new, truly compact compact format is added.
  • <unsuppressibleIssues> makes the issues it lists impossible to suppress.
  • Faster startup: less scanning, and single-file scans no longer build the full project file list. Composer's autoloader is no longer deep-scanned.
  • More detailed progress output, including for taint graph resolution, and short, actionable CLI messages.

Upgrading

For most projects, upgrading is as simple as updating the Composer dependency:

composer require --dev vimeo/psalm:^7.0 -W

Everything else is in the upgrade guide.

Most projects will notice:

  • Taint analysis runs by default. Set runTaintAnalysis="false" to opt out.
  • If enabled via <psalm suggestPurityAnnotations="true">, new MissingPureAnnotation/MissingImmutableAnnotation issues appear for code that can be annotated. Fix them with --alter --issues=MissingPureAnnotation,MissingImmutableAnnotation. The annotations Psalm adds improve both security analysis and type inference:
    • Fewer security false positives: Psalm specializes the taints of calls to pure and read-only functions and methods per call site. Tainted input passed at one call then no longer taints the result of every other call. Without annotations, Psalm can only infer this for functions and methods that can't be overridden.
    • Better type inference: Psalm remembers the results of methods of immutable classes between calls, so $a->get() !== null ? $a->get() : '' is a string. Without @psalm-immutable, the second call is still ?string.
    • Checked contracts: pure code can call the annotated functions, and every override and implementation is checked not to do more than the annotation allows.

Thanks

Thanks to everyone who contributed to Psalm 7, and to everyone who tested the betas and release candidates and reported issues!

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.3...7.0.0

v6.21.4

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.21.3...6.21.4

v6.21.3

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.21.2...6.21.3

v6.21.2

Compare Source

What's Changed

Fixes
  • [6.x] Fix: false AmbiguousConstantInheritance for a constant reached through a parent class and an interface by @​Aerendir in #​12663

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.21.1...6.21.2

v6.21.1

Compare Source

What's Changed

Fixes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.21.0...6.21.1

v6.21.0

Compare Source

What's Changed

Features
  • Add support for reading inheritors from a phpstan-sealed tag by @​stof in #​11818
Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.13...6.21.0

v6.20.13

Compare Source

What's Changed

Fixes
Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.12...6.20.13

v6.20.12

Compare Source

What's Changed

Fixes
  • [6.x] Fix crash when a class extends a class_alias() declared later by @​wleeaf in #​12494

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.11...6.20.12

v6.20.11

Compare Source

What's Changed

Fixes
Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.10...6.20.11

v6.20.10

Compare Source

What's Changed

Fixes
Internal changes
  • Fix 6.x CI: retry transient stub build failures, update array_first test by @​danog in #​13407

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.9...6.20.10

v6.20.9

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.8...6.20.9

v6.20.8

Compare Source

What's Changed

Internal changes
  • [6.x] Push the files composer build regenerates instead of failing by @​danog in #​13147

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.7...6.20.8

v6.20.7

Compare Source

What's Changed

Docs

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.6...6.20.7

v6.20.6

Compare Source

What's Changed

Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.5...6.20.6

v6.20.5

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.4...6.20.5

v6.20.4

Compare Source

What's Changed

Fixes
  • [6.x] Fix: class_alias() of an enum, interface, attribute, trait or type holder crashes with Could not get class storage by @​alies-dev in #​12518
  • [6.x] Fix: type imported through a class_alias() is lost inside an intersection by @​alies-dev in #​12569
  • [6.x] Fix: accept TLiteralClassString of a trait as trait-string by @​no-simpler in #​11783
  • [6.x] Fix: false InvalidAttribute for #[\Deprecated] on traits (PHP 8.5) by @​alies-dev in #​12277
  • [6.x] Narrow Redis keys(), hKeys() and hVals() to lists, declare RedisException and RedisClusterException by @​alies-dev in #​12581
  • [6.x] Fix crash on first-class callable of inherited method by @​alies-dev in #​12582
Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.3...6.20.4

v6.20.3

Compare Source

What's Changed

Fixes
  • [6.x] Fix a ~600 MiB memory regression from 6.19.2 (nullsafe chain state on every node) by @​jarstelfox in #​12493
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.2...6.20.3

v6.20.2

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.1...6.20.2

v6.20.1

Compare Source

What's Changed

Fixes
Internal changes
  • Release master and 6.x every hour when all their checks passed by @​danog in #​12423
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.20.0...6.20.1

v6.20.0

Compare Source

What's Changed

Features
Internal changes
Other changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.19.2...6.20.0

v6.19.2

Compare Source

What's Changed

Features
Fixes
Docs
Internal changes
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.19.1...6.19.2

v6.19.1

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.19.0...6.19.1

v6.19.0

Compare Source

What's Changed

Features
Fixes
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.18.1...6.19.0

v6.18.1

Compare Source

What's Changed

Features
Fixes
  • fix: false-positive NullableReturnStatement when a nullsafe property fetch is compared to a non-nullable value by @​yuriy-sorokin in #​11982
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.18.0...6.18.1

v6.18.0

Compare Source

What's Changed

Features
Fixes
Internal changes
  • Check out branch-specific baselines for test-with-real-projects by @​danog in #​11957
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.17.2...6.18.0

v6.17.2

Compare Source

What's Changed

Fixes
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.17.1...6.17.2

v6.17.1

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.17.0...6.17.1

v6.17.0

Compare Source

What's Changed

Features
  • Support better template inference with type variables: class templates that cannot be inferred at the construction site are now tracked as type variables whose bounds are reconciled once the surrounding function has been analyzed. This legalizes widening within a template's declared bounds (e.g. new Box(1) followed by $box->set('two') under @template T of int|string) and introduces the new IncompatibleTypeParameters issue (level 1), documented in https://psalm.dev/docs/annotating_code/type_variables/ by @​muglug in #​11875
Fixes
  • [6.x] Fix InterfaceAnalyzer crash when storage is overwritten by reflection by @​alies-dev in #​11760
  • [6.x] Fix $this failing to parse inside generic type parameters by @​alies-dev in #​11768
  • [6.x] Use macOS bundle ID for PhpStorm (support JetBrains Tool installed apps), respect PHPSTORM env var on Darwin by @​alies-dev in #​11801
  • [6.x] Ignore inline covariant/contravariant keywords in generic type parameters instead of reporting UndefinedDocblockClass (backport) by @​alies-dev in #​11836
  • Keep foreach key/value non-nullable after a breaking loop by @​muglug in #​11874
  • PHP 8.5 compatibility: TLiteralFloat now renders NAN values as float(NAN) in type keys and IDs instead of crashing by @​danog in 9d6db9e and ca15124
Docs
  • Add docs/annotating_code/type_variables.md and the IncompatibleTypeParameters issue page by @​muglug in #​11875
Internal changes
  • [6.x] fix tests: drop incorrect impure- Closure prefix in TypeParseTest by @​alies-dev in #​11834
  • [6.x] fix tests: whitelist Override in SuicidalAutoloader fixture by @​alies-dev in #​11835
  • fix: pin GitHub Actions to SHA for supply chain security by @​riccardosarro in #​11863
  • Clean up redundant assignment-conditions and repeated getArgs() calls by @​muglug in #​11888
  • Remove dead write-only static properties and simplify ScopeAnalyzer break/continue logic by @​muglug in #​11889
  • Fix test-with-real-projects.sh on macOS (use gsed when available, tolerate a missing phar) by @​danog in 9d6db9e
  • Fix macOS CI: bump setup-php to v2.37.2 so PHP 8.5 installs on macos-15 by @​danog in a2892df
  • Fix Mockery 1.6.15 compatibility in plugin tests by @​danog in 7b50a17
  • Drop voidParamType test: nikic/php-parser 5.8 rejects void params at parse time by @​danog in 056992a
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.16.1...6.17.0

v6.16.1

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.16.0...6.16.1

v6.16.0

Compare Source

What's Changed

Features
Fixes
Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.15.1...6.16.0

v6.15.1

Compare Source

What's Changed

Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.15.0...6.15.1

v6.15.0

Compare Source

Note: GPG signatures for older releases will be regenerated shortly using the new 99BF4D9A33D65E1E key, since the old one expired.

What's Changed

Features
Fixes
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.14.3...6.15.0

v6.14.3

Compare Source

What's Changed

Fixes
Internal changes
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.14.2...6.14.3

v6.14.2

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.14.1...6.14.2

v6.14.1

Compare Source

What's Changed

Features

Full Changelog: https://github.com/vimeo/psalm/compare/6.14.0...6.14.1

v6.14.0

Compare Source

What's Changed

Features
Internal changes
  • Improve performance by avoiding repeated scanning of files included/required only once by @​mmcev106 in #​11478
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.13.1...6.14.0

v6.13.1

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.13.0...6.13.1

v6.13.0

Compare Source

What's Changed

Features
  • ✨ Full support for iterables for iterator_to_array by @​andrew-demb in #​11430
  • Add an arrayCache configuration key that can be used to disable the newly introduced array cache: this will slightly slow down execution times while reducing RAM usage, avoiding OOM issues on bigger codebases by @​danog

Full Changelog: https://github.com/vimeo/psalm/compare/6.12.1...6.13.0

v6.12.1

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.12.0...6.12.1

v6.12.0: - Cache refactoring

Compare Source

This release features a major cache refactoring, improving stability, removing race conditions and adding a new feature called cache consolidation, which consolidates the cache, normally composed of split files, into one single file with the --consolidate-cache flag, for quicker runs when doing whole project scans!

To use cache consolidation, simply run Psalm with the --consolidate-cache flag after running a normal analysis: running with this flag will skip analysis and only consolidate the cache.
If you consolidate your cache in CI runs, sure to re-consolidate the cache again after running Psalm before re-saving the updated cache.

What's Changed

Features
Fixes
Docs

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.11.0...6.12.0

v6.11.0

Compare Source

What's Changed

Features
  • Add new ClassFilePathProviderInterface plugin hook to polyfill custom autoloaders by @​danog in #​11422
Fixes

Subscribe to the brand new Psalm newsletter to stay up to date with all of Psalm's news!

Full Changelog: https://github.com/vimeo/psalm/compare/6.10.3...6.11.0

v6.10.3

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.10.2...6.10.3

v6.10.2

Compare Source

What's Changed

Fixes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.10.1...6.10.2

v6.10.1

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.10.0...6.10.1

v6.10.0

Compare Source

Join the new official Psalm news channel and the Psalm community!

The news channel will be used to share inside exclusive news about upcoming Psalm features (including property hook support, coming within the next few releases!), and the community group can be used to discuss and share the way you use Psalm!

What's Changed

Features

Full Changelog: https://github.com/vimeo/psalm/compare/6.9.6...6.10.0

v6.9.6

Compare Source

Add git, ssh and composer to the docker image by @​danog.

Full Changelog: https://github.com/vimeo/psalm/compare/6.9.5...6.9.6

v6.9.5

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.9.4...6.9.5

v6.9.4

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.9.3...6.9.4

v6.9.3

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.9.2...6.9.3

v6.9.2

Compare Source

Fixes multiplatform builds for the latest tag of the docker image ».

Full Changelog: https://github.com/vimeo/psalm/compare/6.9.1...6.9.2

v6.9.1

Compare Source

v6.9.0: - Docker image!

Compare Source

Psalm now has an official docker image!

It uses a custom build of PHP built from scratch, running Psalm +30% faster on average than normal PHP (+50% faster if comparing to PHP without opcache installed).

To use it, simply run:

docker run -v $PWD:/app --rm -it ghcr.io/danog/psalm:latest /composer/vendor/bin/psalm --no-cache

Issues due to missing extensions can be fixed by enabling them in psalm.xml and/or requiring them in composer.json, see here » for more info.

Extensions not stubbed by Psalm itself (and thus not available as a psalm config option) may be stubbed using traditional PHP stubs.

What's Changed

Features

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.9...6.9.0

v6.8.9

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.8...6.8.9

v6.8.8

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.7...6.8.8

v6.8.7

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.6...6.8.7

v6.8.6

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.5...6.8.6

v6.8.5

Compare Source

What's Changed

Fixes
  • Fixes PHP Error: Undefined array key 1 by @​tm1000 in #​11328
  • Fix issue with plugins by @danog

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.4...6.8.5

v6.8.4

Compare Source

This release introduces fully reproducible builds (the composer.lock file is now added to phars).

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.3...6.8.4

v6.8.3

Compare Source

What's Changed

Fixes
  • Fix phar build by bumping box (the minimum supported PHP version for the phar is now PHP 8.2) by @​danog in #​11324
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.2...6.8.3

v6.8.2

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.1...6.8.2

v6.8.1

Compare Source

What's Changed

Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.8.0...6.8.1

v6.8.0

Compare Source

What's Changed

Features
Fixes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.7.1...6.8.0

v6.7.1

Compare Source

What's Changed

Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.7.0...6.7.1

v6.7.0

Compare Source

What's Changed

Features
  • Add new allowBoolToLiteralBoolComparison config (disabled by default), used to control emission of RedundantIdentityWithTrue issues (previously, their emission was controlled by the strictBinaryOperands config) by @​danog in #​11283
  • Enable missing #[Override] attribute detection (automatic Psalter fixer available) by @​danog in #​11283
  • Enable strict binary operand comparison checks (useful for strict_types migration) by @​danog in #​11283
  • Seal all class properties and methods: this enforces exact description of all class magic (__get/__call...) methods and properties with @method or @property, see here for more info by @​danog in #​11283
  • Disable dangerous @psalm-suppress all annotation (may be re-enabled manually with the disableSuppressAll config) by @​danog in #​11283
  • Types in lazy objects by @​BenMorel in #​11296
Fixes
Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.6.2...6.7.0

v6.6.2

Compare Source

What's Changed

Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.6.1...6.6.2

v6.6.1

Compare Source

What's Changed

Fixes
Docs

Full Changelog: https://github.com/vimeo/psalm/compare/6.6.0...6.6.1

v6.6.0

Compare Source

What's Changed

Features
Fixes
Docs
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.5.1...6.6.0

v6.5.1

Compare Source

What's Changed

Fixes
Internal changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.5.0...6.5.1

v6.5.0

Compare Source

What's Changed

Features
  • The psalm.dev REPL now supports the disableVarParsing config by @​danog
  • Add allFunctionsGlobal and allConstantsGlobal options, useful for legacy codebases which do not use Composer to preload functions and constants by @​danog in #​11259
Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.4.1...6.5.0

v6.4.1

Compare Source

What's Changed

Fixes
Internal changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/6.4.0...6.5.0

v6.4.0

Compare Source

What's Changed

Features
Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.3.0...6.4.0

v6.3.0

Compare Source

This release adds the new psalm-review tool!

What's Changed

Features
Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.2.0...6.3.0

v6.2.0

Compare Source

This release was possible thanks to a Psalm support contract!

This release adds the new LiteralKeyUnshapedArray issue, controlled by the disallowLiteralKeysOnUnshapedArrays configuration flag (false by default), useful to enforce usage of shaped arrays instead of generic arrays.

What's Changed

Features
Fixes

Full Changelog: https://github.com/vimeo/psalm/compare/6.1.0...6.2.0

v6.1.0

Compare Source

This release was possible thanks to a Psalm support contract!

This release greatly improves multithreaded mode, fixing some nasty issues and greatly improving efficiency, thanks to efficient task scheduling powered by amphp/parallel (& some custom code to allow usage of copy-on-write optimizations with forks instead of spawning new processes).

This release also adds a runtime check to prevent Psalm from running on Linux systems where VM overcommitting is disabled: Psalm makes heavy use of VM overcommitting (specifically during forking in multithreaded mode) to greatly reduce RAM usage and improve performance.
Note that in the vast majority of Linux systems, VM overcommitting is already enabled by default.

What's Changed

Features
Fixes
Internal changes
Other changes

Full Changelog: https://github.com/vimeo/psalm/compare/6.0.0...6.1.0

v6.0.0: Psalm v6

Compare Source

This is the first release of Psalm v6!

Users are encouraged to switch to Psalm v6 right away, as v5 is not supported anymore.

Also announcing Psalm's new support model: you can support Psalm development by requesting a support contract from Daniil Gentili, the only active maintainer of Psalm.

Support contracts can cover full integration of Psalm into existing codebases, support for Psalm issues and development of additional Psalm features.

See here » for info, pricing and contact information.

Main highlights of Psalm v6:

  • PHP 8.4 support
  • Amp v3 support
  • PHP-Parser v5 support
  • Fully overhauled dictionaries, for much more accurate and always up to date signatures for PHP and extension functions and methods, and much simpler PHP version upgrades.
  • ignoreInternalFunctionFalseReturn and ignoreInternalFunctionNullReturn are now false by default: this means Psalm now warns when a false/null return type of a native function is not explicitly checked.
  • Modernization of the codebase for higher performance.
  • Many other bugfixes and performance improvements.

Plugin authors should consult the changelog for info about BC-breaking changes.

What's Changed

Features
Fixes
Docs
Internal changes
Typos
Other changes

New Contributors

Full Changelog: https://github.com/vimeo/psalm/compare/5.26.1...6.0.0


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


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

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [vimeo/psalm](https://github.com/vimeo/psalm) | `^5.23` → `^7.0` | ![age](https://developer.mend.io/api/mc/badges/age/packagist/vimeo%2fpsalm/7.18.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/vimeo%2fpsalm/5.26.1/7.18.0?slim=true) | --- ### Release Notes <details> <summary>vimeo/psalm</summary> ### [`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> ### [`v7.3.0`](https://github.com/vimeo/psalm/releases/tag/7.3.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.2.1...7.3.0) <!-- Release notes generated using configuration in .github/release.yml at 6480ee65f252d9829b0c5a49d44c1fa263babfa2 --> #### What's Changed ##### Features - ⭐️ Let plugins declare the issues Psalter can fix by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13515](https://github.com/vimeo/psalm/pull/13515) ##### Fixes - \[7.x] Keep statements of inlined constructor callees: \~15% less wall time and CPU on Laravel (arrayCache=false) by [@&#8203;jarstelfox](https://github.com/jarstelfox) in [#&#8203;13495](https://github.com/vimeo/psalm/pull/13495) - Fix: crash when a class is named only in a template's bound by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13503](https://github.com/vimeo/psalm/pull/13503) - ✨ Fix param-conditional return taking both branches for `$this`/`static` param types by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13494](https://github.com/vimeo/psalm/pull/13494) - Fix: crash of multi-threaded runs without posix by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13517](https://github.com/vimeo/psalm/pull/13517) - Fix: NoInterfaceProperties on a hooked interface property of an intersection type by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13452](https://github.com/vimeo/psalm/pull/13452) - Fix: whitespace around `|` in docblock types drops union members or invalidates `@method` by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13457](https://github.com/vimeo/psalm/pull/13457) - Fix Psalter ignoring the type of static property fetches by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13529](https://github.com/vimeo/psalm/pull/13529) - Fix: hooked interface properties on intersections with a generic interface or a class by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13530](https://github.com/vimeo/psalm/pull/13530) - Fix crash when scope summaries contain non-UTF-8 strings by [@&#8203;MohannadElemary](https://github.com/MohannadElemary) in [#&#8203;13518](https://github.com/vimeo/psalm/pull/13518) - Fix: class property checks lost on intersections with a hooked interface by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13532](https://github.com/vimeo/psalm/pull/13532) - Fix: Psalter rewrites self/static/parent in static property references when renaming a class by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13533](https://github.com/vimeo/psalm/pull/13533) ##### Internal changes - Perf: Avoid quadratic copying when closing dependent classlikes in Populator (\~2.5% faster on a big app) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13508](https://github.com/vimeo/psalm/pull/13508) - chore(baseline): drop the ImplicitToStringCast entry that [#&#8203;11798](https://github.com/vimeo/psalm/issues/11798) made unused by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13507](https://github.com/vimeo/psalm/pull/13507) - Fix PHPUnit plugin diagnostics in self-analysis by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13524](https://github.com/vimeo/psalm/pull/13524) - Perf: Skip building code use edges that are not recorded when consolidating analysed data (\~2% faster on a big app) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13509](https://github.com/vimeo/psalm/pull/13509) ##### Other changes - Fix method name casing in `MissingOverrideAttribute` check by [@&#8203;maximal](https://github.com/maximal) in [#&#8203;11798](https://github.com/vimeo/psalm/pull/11798) - Fix CI Windows path by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13525](https://github.com/vimeo/psalm/pull/13525) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.2.1...7.3.0> ### [`v7.2.1`](https://github.com/vimeo/psalm/releases/tag/7.2.1) [Compare Source](https://github.com/vimeo/psalm/compare/7.2.0...7.2.1) <!-- Release notes generated using configuration in .github/release.yml at 127f608db981d5e1d023603514f7bbfcaae8f570 --> #### What's Changed ##### Fixes - fix(traits): a visibility a trait gives to the methods it uses from another trait reaches its class [#&#8203;6025](https://github.com/vimeo/psalm/issues/6025) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13276](https://github.com/vimeo/psalm/pull/13276) - fix(new-static): do not report UnsafeInstantiation for a class implementing an interface with a constructor [#&#8203;6481](https://github.com/vimeo/psalm/issues/6481) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13265](https://github.com/vimeo/psalm/pull/13265) - fix(operands): don't report \*\* of different numeric types in strict operands mode by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12638](https://github.com/vimeo/psalm/pull/12638) - fix(statements): analyse an interface or an enum declared in another statement by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13129](https://github.com/vimeo/psalm/pull/13129) - fix(assertions): inherit assert-if-true/false from an overridden method and resolve static to the called class [#&#8203;6164](https://github.com/vimeo/psalm/issues/6164) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13283](https://github.com/vimeo/psalm/pull/13283) - fix(traits): ignore type arguments of require-extends and require-implements by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12955](https://github.com/vimeo/psalm/pull/12955) - fix(arrays): keep a list a list when a nested item of it is written through its own key by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12647](https://github.com/vimeo/psalm/pull/12647) - fix(assertions): bool variable identity with true/false keeps its assignment clauses by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12772](https://github.com/vimeo/psalm/pull/12772) - feat(property_exists): type property_exists() of a declared property as true so redundant checks are reported [#&#8203;10436](https://github.com/vimeo/psalm/issues/10436) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13284](https://github.com/vimeo/psalm/pull/13284) - fix(analysis): check property initialisation at every constructor return by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13085](https://github.com/vimeo/psalm/pull/13085) - Do not report a non-empty-array assertion on a possibly empty array as redundant by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13310](https://github.com/vimeo/psalm/pull/13310) - Do not report a paradox between the conditions of one match arm by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13311](https://github.com/vimeo/psalm/pull/13311) - Do not treat the value of a CLI option as a path to check by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13321](https://github.com/vimeo/psalm/pull/13321) - Do not require every key of a literal union after array_key_exists by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13317](https://github.com/vimeo/psalm/pull/13317) - Use the class of an intersection that declares the property by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13320](https://github.com/vimeo/psalm/pull/13320) - Narrow after a negated instanceof static by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13312](https://github.com/vimeo/psalm/pull/13312) - fix(reconciler): a variable holding one literal key is that key for empty() by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13366](https://github.com/vimeo/psalm/pull/13366) - fix(closure): capturing an undefined variable by reference is not an undefined variable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13363](https://github.com/vimeo/psalm/pull/13363) - feat(stubs): add the constants of the curl, ldap and openssl extensions by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13349](https://github.com/vimeo/psalm/pull/13349) - fix(loop): link the data flow of the last loop pass to the reads of the first by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13343](https://github.com/vimeo/psalm/pull/13343) - Infer a template from a class-string bounded template input by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13331](https://github.com/vimeo/psalm/pull/13331) - Fix InternalClass and InternalProperty not reported outside classes by [@&#8203;roxblnfk](https://github.com/roxblnfk) in [#&#8203;13137](https://github.com/vimeo/psalm/pull/13137) - \[7.x] Cut \~280 MB per forked worker's taint graph by unserializing paths without a property table by [@&#8203;jarstelfox](https://github.com/jarstelfox) in [#&#8203;13080](https://github.com/vimeo/psalm/pull/13080) - fix(enums): value-of<> of a constant of an enum resolves the constant by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13300](https://github.com/vimeo/psalm/pull/13300) - Cast the index column of array_column to array keys by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13313](https://github.com/vimeo/psalm/pull/13313) - fix(algebra): a condition is paradoxical when all the clauses of its negation are implied by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13358](https://github.com/vimeo/psalm/pull/13358) - fix(traits): follow a method of a nested trait when checking what a constructor sets by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12673](https://github.com/vimeo/psalm/pull/12673) - fix(inheritance): check omitted optional parameters of interfaces, accept variadic parameters by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13095](https://github.com/vimeo/psalm/pull/13095) - Fix --init error level for paths containing vendor or stub by [@&#8203;MohannadElemary](https://github.com/MohannadElemary) in [#&#8203;13338](https://github.com/vimeo/psalm/pull/13338) - Falsy nullsafe call result no longer makes its receiver null ([#&#8203;6237](https://github.com/vimeo/psalm/issues/6237), [#&#8203;6717](https://github.com/vimeo/psalm/issues/6717)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12739](https://github.com/vimeo/psalm/pull/12739) - Honour the visibility of a trait alias when following constructor calls by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13319](https://github.com/vimeo/psalm/pull/13319) - fix(cli): don't print git's stderr when collecting source control info by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13417](https://github.com/vimeo/psalm/pull/13417) - fix(assignment): nested write to an existing list offset keeps the list by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13408](https://github.com/vimeo/psalm/pull/13408) - fix(call): [@&#8203;param-out](https://github.com/param-out) template is not widened by the argument's own type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13426](https://github.com/vimeo/psalm/pull/13426) - fix(templates): resolve the own templates of an implemented template argument at the call by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13400](https://github.com/vimeo/psalm/pull/13400) - fix(templates): get_class($x) binds a class-string<T> template to the class of $x by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13378](https://github.com/vimeo/psalm/pull/13378) - fix(magic-get): call \_\_get with the property name as written, not as a string literal by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13397](https://github.com/vimeo/psalm/pull/13397) - fix(cast): string cast of an intersection uses the narrowest \_\_toString by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13421](https://github.com/vimeo/psalm/pull/13421) - fix(language-server): the quick fix for an issue inserts the suppression instead of rewriting the line by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13383](https://github.com/vimeo/psalm/pull/13383) - fix(loops): break N tells the outer loop it targets about the break by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13376](https://github.com/vimeo/psalm/pull/13376) - fix(config): an issue named twice in the issueHandlers keeps what both elements say by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13404](https://github.com/vimeo/psalm/pull/13404) - fix(docblock): trailing semicolon after a parameter name by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13410](https://github.com/vimeo/psalm/pull/13410) - \[7.x] Cut forked taint runs \~40% (700 s to 413 s) by serializing taint nodes with an index into a list of locations by [@&#8203;jarstelfox](https://github.com/jarstelfox) in [#&#8203;13074](https://github.com/vimeo/psalm/pull/13074) - fix(ternary): keep variables assigned in every branch of a nested ternary or match by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13395](https://github.com/vimeo/psalm/pull/13395) - fix(docblock): a TypeParseTreeException in a [@&#8203;mixin](https://github.com/mixin) / [@&#8203;psalm-require-](https://github.com/psalm-require-)\* type is an issue, not a crash by [@&#8203;GBra-4-669](https://github.com/GBra-4-669) in [#&#8203;13158](https://github.com/vimeo/psalm/pull/13158) - fix(array-fetch): a missing literal key in isset/?? no longer makes the fetch mixed by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13427](https://github.com/vimeo/psalm/pull/13427) - Forget the issues of the old body of a method whose body got shorter by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13476](https://github.com/vimeo/psalm/pull/13476) - fix(templates): resolve the other templates a constraint names when new leaves a template unbound by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13090](https://github.com/vimeo/psalm/pull/13090) - fix(static-props): static::$x is not the same variable as self::$x by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13364](https://github.com/vimeo/psalm/pull/13364) - fix(assertions): say "empty array" when an array is compared with \[] by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12652](https://github.com/vimeo/psalm/pull/12652) ##### Docs - docs: correct resolveFromConfigFile default and cacheDirectory note by [@&#8203;ZainnQureshii](https://github.com/ZainnQureshii) in [#&#8203;13481](https://github.com/vimeo/psalm/pull/13481) ##### Internal changes - Fix CI after interaction between two PR by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13490](https://github.com/vimeo/psalm/pull/13490) - fix CI after regression by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13492](https://github.com/vimeo/psalm/pull/13492) ##### Other changes - fix(templates): equality bounds that are type variables of the same type are one type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13403](https://github.com/vimeo/psalm/pull/13403) - fix(plugins): FunctionCasingChecker and trait aliases by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13416](https://github.com/vimeo/psalm/pull/13416) #### New Contributors - [@&#8203;ZainnQureshii](https://github.com/ZainnQureshii) made their first contribution in [#&#8203;13481](https://github.com/vimeo/psalm/pull/13481) - [@&#8203;MohannadElemary](https://github.com/MohannadElemary) made their first contribution in [#&#8203;13338](https://github.com/vimeo/psalm/pull/13338) - [@&#8203;GBra-4-669](https://github.com/GBra-4-669) made their first contribution in [#&#8203;13158](https://github.com/vimeo/psalm/pull/13158) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.2.0...7.2.1> ### [`v7.2.0`](https://github.com/vimeo/psalm/releases/tag/7.2.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.1.0...7.2.0) <!-- Release notes generated using configuration in .github/release.yml at 7c1fcd8a86b7912663bffd385da323dd8dcce1c5 --> #### What's Changed ##### Features - Report `HiddenGeneratorReturn` for a value a generator returns through a type without Generator by [@&#8203;alies-dev](https://github.com/alies-dev) & [@&#8203;azjezz](https://github.com/azjezz) in [#&#8203;13485](https://github.com/vimeo/psalm/pull/13485) ##### Fixes - fix(docblock): check the classes of [@&#8203;global](https://github.com/global) types by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13170](https://github.com/vimeo/psalm/pull/13170) - Fix: static bound to a receiver is bound again on every call inside a template argument (also fixes OOM) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13442](https://github.com/vimeo/psalm/pull/13442) - Fix: show the auto-fix suggestion footer when taint analysis runs by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13450](https://github.com/vimeo/psalm/pull/13450) - fix(types): combining object shapes keeps the properties of both by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13444](https://github.com/vimeo/psalm/pull/13444) - fix(stubs): the inner iterator template of the SPL iterator wrappers has a default by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13443](https://github.com/vimeo/psalm/pull/13443) - fix(types): a narrower native return type wins over an inherited docblock with a \_\_toString coercion by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12959](https://github.com/vimeo/psalm/pull/12959) - Give MethodParamsProviderEvent the location of the call by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13325](https://github.com/vimeo/psalm/pull/13325) - fix(scanner): suppress MissingClassConstType on the class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12932](https://github.com/vimeo/psalm/pull/12932) - Accept non-ASCII variable names in [@&#8203;param](https://github.com/param), [@&#8203;param-out](https://github.com/param-out), [@&#8203;global](https://github.com/global) and [@&#8203;property](https://github.com/property) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12700](https://github.com/vimeo/psalm/pull/12700) - fix(callmap): mysqli get_warnings may return false by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12826](https://github.com/vimeo/psalm/pull/12826) - fix(alter): keep the data flow of a read fixed as possibly undefined by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13386](https://github.com/vimeo/psalm/pull/13386) - Infer a literal string for trim() of a literal string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12602](https://github.com/vimeo/psalm/pull/12602) - Keep $this as it was after following a method called in a constructor by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13332](https://github.com/vimeo/psalm/pull/13332) - fix(by-ref): accept a constant or call result for a parameter only the stub takes by reference [#&#8203;7505](https://github.com/vimeo/psalm/issues/7505) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13263](https://github.com/vimeo/psalm/pull/13263) - fix(stubs): type array_find, array_find_key, array_first and array_last by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12642](https://github.com/vimeo/psalm/pull/12642) - Treat a while loop whose condition holds for the literal start as always entered by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12622](https://github.com/vimeo/psalm/pull/12622) - fix(throws): report uncaught exceptions thrown inside foreach, for and while loops by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13229](https://github.com/vimeo/psalm/pull/13229) - fix(loop): the value of a foreach iteration is not the one the last iteration ended with by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13437](https://github.com/vimeo/psalm/pull/13437) - Don't crash psalter on properties declared together by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12599](https://github.com/vimeo/psalm/pull/12599) - Honour an inline [@&#8203;psalm-suppress](https://github.com/psalm-suppress) UnusedVariable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12611](https://github.com/vimeo/psalm/pull/12611) - Don't report a nullable array key from an ignored nullable return by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12605](https://github.com/vimeo/psalm/pull/12605) - Keep a concatenation with mixed no emptier than its other operand by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12591](https://github.com/vimeo/psalm/pull/12591) - Accept <directory> in <stubs> by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12600](https://github.com/vimeo/psalm/pull/12600) - Apply a conditional [@&#8203;psalm-taint-escape](https://github.com/psalm-taint-escape) to calls of instance methods by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12621](https://github.com/vimeo/psalm/pull/12621) - Accept interfaces in universalObjectCrates and cover their implementations by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12612](https://github.com/vimeo/psalm/pull/12612) - fix(ternary): narrow by the branch that finishes when the other one throws or exits by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12639](https://github.com/vimeo/psalm/pull/12639) - fix(properties): report docblock type issues of a typed property at the docblock by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12636](https://github.com/vimeo/psalm/pull/12636) - Scan the classes of the global variables of the config by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12631](https://github.com/vimeo/psalm/pull/12631) - Give the closure of a method of a generic object the templates of the object by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12624](https://github.com/vimeo/psalm/pull/12624) - fix(int-range): don't overflow the bound for a comparison with PHP_INT_MAX or PHP_INT_MIN by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12644](https://github.com/vimeo/psalm/pull/12644) - fix(property-fetch): read a shape property of an interface intersected with an object shape by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12666](https://github.com/vimeo/psalm/pull/12666) - fix(property-assign): assign a private property of the current class on an object of a child class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12669](https://github.com/vimeo/psalm/pull/12669) - fix(callmap): accept any type as the argument of assert() by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12664](https://github.com/vimeo/psalm/pull/12664) - fix(param-default): report a new-expression default that cannot satisfy an interface type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12661](https://github.com/vimeo/psalm/pull/12661) - fix(reconciler): don't take the id of static::class or self::class for a literal array key by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12650](https://github.com/vimeo/psalm/pull/12650) - Report str_replace() with fewer replacements than searches by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12604](https://github.com/vimeo/psalm/pull/12604) - fix(static-calls): self::, static:: and parent:: return the static type of the calling class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12643](https://github.com/vimeo/psalm/pull/12643) - feat(assertions): add [@&#8203;psalm-assert](https://github.com/psalm-assert) array-key-exists $array\[$key] by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12634](https://github.com/vimeo/psalm/pull/12634) - fix(conditions): the right operand of && keeps what the left one guards by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12657](https://github.com/vimeo/psalm/pull/12657) - fix(try): a finally also sees what a try nested in the body throws or returns by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12675](https://github.com/vimeo/psalm/pull/12675) - Fix: empty array takes both branches of a conditional with a union subject containing non-empty-array by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12447](https://github.com/vimeo/psalm/pull/12447) - Fix: `empty` and `falsy` conditional conditions resolve to the else branch by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12448](https://github.com/vimeo/psalm/pull/12448) - fix(assertions): keep every alternative of a union in [@&#8203;psalm-assert-if-true/false](https://github.com/psalm-assert-if-true/false) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12635](https://github.com/vimeo/psalm/pull/12635) - Don't report a generator that never finishes as returning never by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12698](https://github.com/vimeo/psalm/pull/12698) - fix(callmap): choose an overload by the parameter a named argument names by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12683](https://github.com/vimeo/psalm/pull/12683) - Keep what a continue assigns to loop-defined variables in the do-while condition by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12699](https://github.com/vimeo/psalm/pull/12699) - Keep analyzing after an undefined or possibly undefined variable in a closure use list by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12704](https://github.com/vimeo/psalm/pull/12704) - Include the properties of the traits a class uses in properties-of by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12711](https://github.com/vimeo/psalm/pull/12711) - Give a variable assigned in finally the type it has after the finally block by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12733](https://github.com/vimeo/psalm/pull/12733) - Concatenate literals with small int ranges as literals ([#&#8203;10947](https://github.com/vimeo/psalm/issues/10947)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12740](https://github.com/vimeo/psalm/pull/12740) - Evaluate the conditional type of a parameter in the body of the function by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12736](https://github.com/vimeo/psalm/pull/12736) - Keep a boolean variable's narrowing after an || with it as left operand ([#&#8203;12395](https://github.com/vimeo/psalm/issues/12395)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12751](https://github.com/vimeo/psalm/pull/12751) - Report comparisons guaranteed by an int range bound as redundant ([#&#8203;8059](https://github.com/vimeo/psalm/issues/8059)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12741](https://github.com/vimeo/psalm/pull/12741) - Keep an instantiable class among its [@&#8203;psalm-inheritors](https://github.com/psalm-inheritors) when narrowing a negated instanceof by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12713](https://github.com/vimeo/psalm/pull/12713) - Read the flags of html functions by name for taint analysis ([#&#8203;12250](https://github.com/vimeo/psalm/issues/12250)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12759](https://github.com/vimeo/psalm/pull/12759) - interface-string and enum-string only accept literals of interfaces and enums ([#&#8203;12577](https://github.com/vimeo/psalm/issues/12577)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12754](https://github.com/vimeo/psalm/pull/12754) - fix(include): normalize the path of a file_exists guard by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12778](https://github.com/vimeo/psalm/pull/12778) - fix(taint): keep pseudo-property taint when read through an object shape by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12793](https://github.com/vimeo/psalm/pull/12793) - fix(traits): honour insteadof and trait-qualified aliases by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12775](https://github.com/vimeo/psalm/pull/12775) - fix(attributes): analyse the attributes of class constants by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12789](https://github.com/vimeo/psalm/pull/12789) - feat(sarif): add a security-severity score to the rules of taint issues by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12809](https://github.com/vimeo/psalm/pull/12809) - fix(properties): a property typed with an imported alias is invariant with the parent's by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12827](https://github.com/vimeo/psalm/pull/12827) - fix(unused-code): keep the method of a callable array passed as array|callable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12848](https://github.com/vimeo/psalm/pull/12848) - fix(callables): a callable array of an intersection finds the method in any of its types by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12831](https://github.com/vimeo/psalm/pull/12831) - Report a negated method_exists() of a class with the method as impossible by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12730](https://github.com/vimeo/psalm/pull/12730) - Remove the excluded classes from the bound of a template param after a negated instanceof by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12718](https://github.com/vimeo/psalm/pull/12718) - fix(types): reconcile type variables of namespaced file-scope code by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12858](https://github.com/vimeo/psalm/pull/12858) - fix(args): named argument named like the variadic parameter is not a duplicate by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12866](https://github.com/vimeo/psalm/pull/12866) - feat(constants): resolve << and >> in constant expressions by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12878](https://github.com/vimeo/psalm/pull/12878) - fix(operators): allow arithmetic on BcMath\Number by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12870](https://github.com/vimeo/psalm/pull/12870) - fix(types): no redundant property initialization check in constructor by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12859](https://github.com/vimeo/psalm/pull/12859) - fix(types): (array) on a Closure is a one-element list by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12881](https://github.com/vimeo/psalm/pull/12881) - fix(array-access): name the array in messages when the expression has no variable id by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12887](https://github.com/vimeo/psalm/pull/12887) - fix(docblock): a [@&#8203;method](https://github.com/method) named like a type keyword is a method by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12895](https://github.com/vimeo/psalm/pull/12895) - fix(switch): keep analysing a switch after a paradoxical default by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12879](https://github.com/vimeo/psalm/pull/12879) - fix(cli): --version does not need the autoloaders of the project by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12917](https://github.com/vimeo/psalm/pull/12917) - fix(call): a method of an intersected type is not routed through \_\_call of another by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12970](https://github.com/vimeo/psalm/pull/12970) - fix(stubs): class_parents, class_implements and class_uses never return false for an object by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12905](https://github.com/vimeo/psalm/pull/12905) - fix(loop): a variable unset in a loop body is possibly undefined in the next iteration by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12960](https://github.com/vimeo/psalm/pull/12960) - fix(switch): variables assigned by every case count as assigned in the enclosing scope by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12933](https://github.com/vimeo/psalm/pull/12933) - fix(templates): resolve inherited method docblock types through subclass templates by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12951](https://github.com/vimeo/psalm/pull/12951) - fix(enum): resolve value-of<T> argument of Enum::from and tryFrom by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12943](https://github.com/vimeo/psalm/pull/12943) - fix(messages): name a missing return type mixed in the signature mismatch by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12820](https://github.com/vimeo/psalm/pull/12820) - parent::/self::/static:: calls of a method returning $this return $this ([#&#8203;12275](https://github.com/vimeo/psalm/issues/12275)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12753](https://github.com/vimeo/psalm/pull/12753) - fix(assertions): keep every member of a union in assert-if-true and assert-if-false by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12836](https://github.com/vimeo/psalm/pull/12836) - fix(array_filter): narrow the result of a call with a string callable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12991](https://github.com/vimeo/psalm/pull/12991) - fix(static-call): a static call of a method no class defines keeps its return type while properties are collected by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13081](https://github.com/vimeo/psalm/pull/13081) - fix(unused): magic methods keep their required params and \_\_callStatic is used by magic static calls by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13007](https://github.com/vimeo/psalm/pull/13007) - fix(analysis): drop known elements of a variable redeclared by [@&#8203;var](https://github.com/var) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13088](https://github.com/vimeo/psalm/pull/13088) - feat(generators): report an implicit return of a generator whose return type isn't nullable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13102](https://github.com/vimeo/psalm/pull/13102) - fix(echo): cast an object operand to string whatever the analysis mode by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13104](https://github.com/vimeo/psalm/pull/13104) - fix(types): resolve static of parent:: calls to the calling class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12845](https://github.com/vimeo/psalm/pull/12845) - fix(foreach): assign the key after the value like PHP by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12792](https://github.com/vimeo/psalm/pull/12792) - A static call of an inaccessible method goes to \_\_callStatic ([#&#8203;11876](https://github.com/vimeo/psalm/issues/11876)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12767](https://github.com/vimeo/psalm/pull/12767) - fix(templates): a template replaced by an intersection keeps the intersection by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12976](https://github.com/vimeo/psalm/pull/12976) - fix(foreach): type the key and the value of a class-string-map by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12818](https://github.com/vimeo/psalm/pull/12818) - Check the native type of a parameter or property whose docblock type is mixed or a template by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12703](https://github.com/vimeo/psalm/pull/12703) - Combine enum ->value/->name types across the receiver's parts ([#&#8203;11171](https://github.com/vimeo/psalm/issues/11171)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12744](https://github.com/vimeo/psalm/pull/12744) - fix(reconciler): narrow iterable with a class through Traversable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12773](https://github.com/vimeo/psalm/pull/12773) - fix(unused): analyse the arguments of a call to an unknown function or class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12802](https://github.com/vimeo/psalm/pull/12802) - fix(docblock): check only the last docblock type of a property or constant by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13117](https://github.com/vimeo/psalm/pull/13117) - fix(cli): only a SARIF report keeps a taint analysis in GitHub Actions from failing by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13233](https://github.com/vimeo/psalm/pull/13233) - fix(types): keep the type of a declared key when combining unsealed arrays by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13175](https://github.com/vimeo/psalm/pull/13175) - foreach over a nullable or falsable value may not run ([#&#8203;12513](https://github.com/vimeo/psalm/issues/12513)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12746](https://github.com/vimeo/psalm/pull/12746) - fix(try): a variable assigned in a do-while that runs once is assigned after the try by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13205](https://github.com/vimeo/psalm/pull/13205) - fix(args): report unpacking a union of an array and a non-iterable type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13127](https://github.com/vimeo/psalm/pull/13127) - fix(constructors): a class marked [@&#8203;psalm-consistent-constructor](https://github.com/psalm-consistent-constructor) keeps the constructor it inherits by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13084](https://github.com/vimeo/psalm/pull/13084) - fix(properties): keep the initializing class of a property assigned a template-replaced type [#&#8203;10097](https://github.com/vimeo/psalm/issues/10097) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13260](https://github.com/vimeo/psalm/pull/13260) - fix(stubs): iterating a Ds map, set, vector or deque is mutation-free [#&#8203;12433](https://github.com/vimeo/psalm/issues/12433) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13272](https://github.com/vimeo/psalm/pull/13272) - fix(static): resolve `static` in the parameters of a static method called by class name to that class [#&#8203;5535](https://github.com/vimeo/psalm/issues/5535) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13261](https://github.com/vimeo/psalm/pull/13261) - fix(array-functions): array_udiff() and the other callback-comparing diff functions return the first array's entries [#&#8203;10062](https://github.com/vimeo/psalm/issues/10062) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13270](https://github.com/vimeo/psalm/pull/13270) - fix(destructuring): report MixedAssignment for a mixed value destructured by key [#&#8203;4345](https://github.com/vimeo/psalm/issues/4345) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13274](https://github.com/vimeo/psalm/pull/13274) - fix(assertions): keep the existing array type where a negated array assertion holds [#&#8203;13166](https://github.com/vimeo/psalm/issues/13166) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13269](https://github.com/vimeo/psalm/pull/13269) - A type alias that uses the template of its class is an InvalidDocblock, in or out of a namespace by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12734](https://github.com/vimeo/psalm/pull/12734) - A literal naming a function is a string for a Closure|string param ([#&#8203;12585](https://github.com/vimeo/psalm/issues/12585)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12755](https://github.com/vimeo/psalm/pull/12755) - fix(traits): do not inherit a private property imported from a trait into subclasses [#&#8203;5062](https://github.com/vimeo/psalm/issues/5062) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13264](https://github.com/vimeo/psalm/pull/13264) - fix(scanner): resolving a class_exists guard must not run the autoloader by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12807](https://github.com/vimeo/psalm/pull/12807) - fix(reconciler): negate the nested assertions of an assigning condition by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13124](https://github.com/vimeo/psalm/pull/13124) - Fix: namespaced printing drops class-string type arguments and the interface-string kind by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13479](https://github.com/vimeo/psalm/pull/13479) - Fix: crash on first-class callables in `count()`/`gettype()`/`get_class()` conditions by [@&#8203;alies-dev](https://github.com/alies-dev) & [@&#8203;azjezz](https://github.com/azjezz) in [#&#8203;13484](https://github.com/vimeo/psalm/pull/13484) - Infer 'Array' for array-to-string casts by [@&#8203;alies-dev](https://github.com/alies-dev) & [@&#8203;azjezz](https://github.com/azjezz) in [#&#8203;13486](https://github.com/vimeo/psalm/pull/13486) ##### Docs - docs: link memoizeMethodCallResults to memoization by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13456](https://github.com/vimeo/psalm/pull/13456) ##### Internal changes - Add Tempest to the perf corpus and bump corpus projects by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13459](https://github.com/vimeo/psalm/pull/13459) - Stop bundling `psalm/plugin-sabre-event` and allow `psalm/plugin-phpunit` 1.0 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13478](https://github.com/vimeo/psalm/pull/13478) - Allow psalm/plugin-phpunit 0.22 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13480](https://github.com/vimeo/psalm/pull/13480) - Refactor to prevent ComplexMethod by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13482](https://github.com/vimeo/psalm/pull/13482) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.1.0...7.2.0> ### [`v7.1.0`](https://github.com/vimeo/psalm/releases/tag/7.1.0) [Compare Source](https://github.com/vimeo/psalm/compare/7.0.5...7.1.0) <!-- Release notes generated using configuration in .github/release.yml at d43883d6651b6a69e89028c65b36dcfdbb79105f --> #### What's Changed ##### Features - fix(parser): allow a trailing comma in array and list shapes by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13228](https://github.com/vimeo/psalm/pull/13228) ##### Fixes - :sparkles: \[[#&#8203;11509](https://github.com/vimeo/psalm/issues/11509)] Fix regression about iterables, list and conditional types by [@&#8203;andrew-demb](https://github.com/andrew-demb) in [#&#8203;11558](https://github.com/vimeo/psalm/pull/11558) - test(psalter): pin a constructor inherited from another file with MissingThrowsDocblock by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13346](https://github.com/vimeo/psalm/pull/13346) - feat(stubs): substr of a non-empty-string from its start is non-empty by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12921](https://github.com/vimeo/psalm/pull/12921) - fix(properties): the self of a trait property signature is the using class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12919](https://github.com/vimeo/psalm/pull/12919) - fix(isset): a variable not set by the isset branch stays possibly undefined after the if by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13046](https://github.com/vimeo/psalm/pull/13046) - fix(unused): a call on the left of ?? is used by the coalesce by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13231](https://github.com/vimeo/psalm/pull/13231) - fix(call): give the callback of usort() and its siblings the element type of the array by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13347](https://github.com/vimeo/psalm/pull/13347) - fix(call): keep the narrowed type of an unchanged argument in strict_types by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13341](https://github.com/vimeo/psalm/pull/13341) - fix(parser): accept a name after the = or ... of a callable param by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13226](https://github.com/vimeo/psalm/pull/13226) - fix(types): a literal string id does not use the C escapes \a and \b by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13209](https://github.com/vimeo/psalm/pull/13209) - fix(loop): report break/continue levels exceeding the enclosing structures by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13210](https://github.com/vimeo/psalm/pull/13210) - fix(foreach): drop the invalid-iteration null of an Iterator's current() and key() by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13218](https://github.com/vimeo/psalm/pull/13218) - fix(interface): report an undefined interface in an interface's extends list by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13212](https://github.com/vimeo/psalm/pull/13212) - fix(inheritance): compare constructors that override an abstract constructor by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13211](https://github.com/vimeo/psalm/pull/13211) - fix(docblock): report the class issues of a [@&#8203;var](https://github.com/var) type at the docblock by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13182](https://github.com/vimeo/psalm/pull/13182) - fix(return): report a void|never docblock return type that can only return implicitly by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13169](https://github.com/vimeo/psalm/pull/13169) - fix(strings): keep the literals of a union in an interpolated string by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13130](https://github.com/vimeo/psalm/pull/13130) - fix(try): a catch whose every path leaves does not make the variables of the try possibly undefined by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13183](https://github.com/vimeo/psalm/pull/13183) - fix(unused): report the unused result of a pure static method call by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13197](https://github.com/vimeo/psalm/pull/13197) - fix(properties): a redeclared protected property is accessible from the classes of its first declaration by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13203](https://github.com/vimeo/psalm/pull/13203) - fix(docblock): a tag of a single-line docblock has no trailing blank by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13193](https://github.com/vimeo/psalm/pull/13193) - Handle missing parents when checking inherited constants by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13414](https://github.com/vimeo/psalm/pull/13414) - fix(params): honour [@&#8203;psalm-suppress](https://github.com/psalm-suppress) InvalidParamDefault by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13172](https://github.com/vimeo/psalm/pull/13172) - fix(callable): resolve \[object, 'method'] callables to inherited and trait methods by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13214](https://github.com/vimeo/psalm/pull/13214) - fix(docblock): allow a trailing comma in a generic type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13208](https://github.com/vimeo/psalm/pull/13208) - fix(stubs): FFI::memcmp prefers references but also accepts values by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13173](https://github.com/vimeo/psalm/pull/13173) - \[6.x] Fix crash when a closure unsets a by-reference captured variable (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12058](https://github.com/vimeo/psalm/pull/12058) - \[6.x] Fix type variables bounded by another type variable (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12059](https://github.com/vimeo/psalm/pull/12059) - Fix: don't report plugin-appended class and method suppressions as unused by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12033](https://github.com/vimeo/psalm/pull/12033) ##### Internal changes - Accept negative integer keys in the composer build patch check by [@&#8203;danog](https://github.com/danog) in [#&#8203;13406](https://github.com/vimeo/psalm/pull/13406) - Fix 6.x CI: retry transient stub build failures, update array_first test by [@&#8203;danog](https://github.com/danog) in [#&#8203;13407](https://github.com/vimeo/psalm/pull/13407) - Merge 6.x into master by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13438](https://github.com/vimeo/psalm/pull/13438) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.0.5...7.1.0> ### [`v7.0.5`](https://github.com/vimeo/psalm/releases/tag/7.0.5) [Compare Source](https://github.com/vimeo/psalm/compare/7.0.4...7.0.5) <!-- Release notes generated using configuration in .github/release.yml at e3586fb9542ad66e37122f7c7ddf6b9a9ea7eaec --> #### What's Changed ##### Fixes - feat(taint): json_encode() without JSON_PRETTY_PRINT removes the header taint by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12799](https://github.com/vimeo/psalm/pull/12799) - Feature/callmap signature return types by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13167](https://github.com/vimeo/psalm/pull/13167) - Exclude extension polyfills from PHP-versioned callmaps by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13345](https://github.com/vimeo/psalm/pull/13345) - fix(methods): static return of an inherited method is the class that inherits it by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12994](https://github.com/vimeo/psalm/pull/12994) - fix(callmap): PDO::sqliteCreateFunction() takes flags since PHP 7.1.4 by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12865](https://github.com/vimeo/psalm/pull/12865) - fix(callmap): define() accepts any value since PHP 8.1 by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12992](https://github.com/vimeo/psalm/pull/12992) ##### Internal changes - Add zstd cache compression with a dictionary for the consolidated cache by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13309](https://github.com/vimeo/psalm/pull/13309) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.0.4...7.0.5> ### [`v7.0.4`](https://github.com/vimeo/psalm/releases/tag/7.0.4) [Compare Source](https://github.com/vimeo/psalm/compare/7.0.3...7.0.4) <!-- Release notes generated using configuration in .github/release.yml at fa5b1f6e665cb743838ffd865b8fc96207f9409f --> #### What's Changed ##### Fixes - fix(baseline): merge duplicated files and issue types when reading a baseline by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13098](https://github.com/vimeo/psalm/pull/13098) - fix(visibility): drop the empty context from the inaccessible method message by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13094](https://github.com/vimeo/psalm/pull/13094) - fix(psalter): replace the whole union return type by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13116](https://github.com/vimeo/psalm/pull/13116) - fix(arithmetic): don't fold a shift by a negative number or zero to a negative power by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13103](https://github.com/vimeo/psalm/pull/13103) - fix(int-range): an int range without bounds is int by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13091](https://github.com/vimeo/psalm/pull/13091) - fix(types): a negated instanceof narrows the bound of a template param by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12906](https://github.com/vimeo/psalm/pull/12906) - fix(types): keep named objects and other shapes next to an object with properties by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13101](https://github.com/vimeo/psalm/pull/13101) - Perf: skip recording code use edges that nothing reads (2–32% less memory when unused code detection is off) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13250](https://github.com/vimeo/psalm/pull/13250) - Evaluate the keys of array items passed by reference once by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13297](https://github.com/vimeo/psalm/pull/13297) - Fix: constants defined in Psalm's process turn into mixed on warm runs by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13302](https://github.com/vimeo/psalm/pull/13302) - fix(int-range): a negative int to the power of 0 is 1 by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13186](https://github.com/vimeo/psalm/pull/13186) - fix(stubs): SplDoublyLinkedList::offsetSet accepts null to append by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13207](https://github.com/vimeo/psalm/pull/13207) - fix(parser): as, of and is are keys of a shape where a colon follows by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13075](https://github.com/vimeo/psalm/pull/13075) - fix(types): $\_COOKIE can have int keys by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12868](https://github.com/vimeo/psalm/pull/12868) - fix(config): count referencedFunction issue handler suppressions by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12854](https://github.com/vimeo/psalm/pull/12854) - fix(scanner): an and/or condition of unknown parts defines both branches by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12814](https://github.com/vimeo/psalm/pull/12814) - Keep the type of the elements array_splice() returns by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12615](https://github.com/vimeo/psalm/pull/12615) - fix(param-out): do not check the [@&#8203;param-out](https://github.com/param-out) of a method without a body by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12681](https://github.com/vimeo/psalm/pull/12681) - Ask whether the package of an unknown plugin class is installed by [@&#8203;danog](https://github.com/danog) in [#&#8203;13326](https://github.com/vimeo/psalm/pull/13326) ##### Internal changes - Perf: speed up warm runs and the consolidated cache with one file per cache entry by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13249](https://github.com/vimeo/psalm/pull/13249) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.0.3...7.0.4> ### [`v7.0.3`](https://github.com/vimeo/psalm/releases/tag/7.0.3) [Compare Source](https://github.com/vimeo/psalm/compare/7.0.2...7.0.3) <!-- Release notes generated using configuration in .github/release.yml at 8f2ac04d0ab5ed1d3cbe6e252b0f7232bc031aaf --> #### What's Changed ##### Fixes - Fix: issues found while scanning are lost with a warm cache by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13156](https://github.com/vimeo/psalm/pull/13156) - fix(types): an array key that may be mixed is array-key by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13176](https://github.com/vimeo/psalm/pull/13176) - Fix implicit native \_\_toString overrides and safeguard callmap generation by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;13235](https://github.com/vimeo/psalm/pull/13235) - Fix LSP lookup of builtin functions in files not analyzed in-process by [@&#8203;M393](https://github.com/M393) in [#&#8203;13237](https://github.com/vimeo/psalm/pull/13237) - \[6.x] Infer return types for `array_first` and `array_last` (PHP 8.5) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12157](https://github.com/vimeo/psalm/pull/12157) - \[6.x] Infer the key parameter of `array_find`/`array_any`/`array_all` callbacks by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13245](https://github.com/vimeo/psalm/pull/13245) - \[6.x] Infer the exact element removed by `array_pop`/`array_shift` by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13246](https://github.com/vimeo/psalm/pull/13246) - fix(algebra): keep every orred clause of a variable when reconciling by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13114](https://github.com/vimeo/psalm/pull/13114) - fix(types): an inherited docblock identical to the native return type keeps static of the called class by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12968](https://github.com/vimeo/psalm/pull/12968) - fix(templates): check a method call against every type of a union template bound by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13106](https://github.com/vimeo/psalm/pull/13106) ##### Docs - Document the Psalm GitHub actions by [@&#8203;danog](https://github.com/danog) in [#&#8203;13051](https://github.com/vimeo/psalm/pull/13051) - Document --consolidate-cache by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13256](https://github.com/vimeo/psalm/pull/13256) ##### Internal changes - Add guzzle/promises to the perf corpus by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12984](https://github.com/vimeo/psalm/pull/12984) - Push the docker image to ghcr.io/psalm/psalm by [@&#8203;danog](https://github.com/danog) in [#&#8203;13044](https://github.com/vimeo/psalm/pull/13044) - \[6.x] Push the files composer build regenerates instead of failing by [@&#8203;danog](https://github.com/danog) in [#&#8203;13147](https://github.com/vimeo/psalm/pull/13147) - Perf: stop parsing the same vendor files again and again (10–55% less CPU on projects extending vendor classes) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13234](https://github.com/vimeo/psalm/pull/13234) - Social medial: announce on X and Mastodon only the releases worth a post by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13241](https://github.com/vimeo/psalm/pull/13241) - Merge 6.x into master by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13243](https://github.com/vimeo/psalm/pull/13243) - Merge 6.x into master by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13247](https://github.com/vimeo/psalm/pull/13247) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.0.2...7.0.3> ### [`v7.0.2`](https://github.com/vimeo/psalm/releases/tag/7.0.2) [Compare Source](https://github.com/vimeo/psalm/compare/7.0.1...7.0.2) <!-- Release notes generated using configuration in .github/release.yml at 5cd5e2ffff7497643dd51da31ae85bb5bc593090 --> #### What's Changed ##### Fixes - Fix the caller of [@&#8203;internal](https://github.com/internal) checks in namespaced functions by [@&#8203;roxblnfk](https://github.com/roxblnfk) in [#&#8203;13136](https://github.com/vimeo/psalm/pull/13136) - Perf: speed up analysis with a warm cache by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13153](https://github.com/vimeo/psalm/pull/13153) - fix(unused): don't track a static property in a destructuring as a variable by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13100](https://github.com/vimeo/psalm/pull/13100) - Fix: warm-cache crash when a file is reached under two spellings of its path by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13155](https://github.com/vimeo/psalm/pull/13155) - fix(psalter): a mixed argument makes the inferred parameter type mixed by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13110](https://github.com/vimeo/psalm/pull/13110) - Fix: cache reads crash while another worker rewrites the entry by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13154](https://github.com/vimeo/psalm/pull/13154) ##### Internal changes - Only push docs changes from composer build that add issue links by [@&#8203;danog](https://github.com/danog) in [#&#8203;13148](https://github.com/vimeo/psalm/pull/13148) - Fix release announcements failing on every platform by [@&#8203;danog](https://github.com/danog) in [#&#8203;13159](https://github.com/vimeo/psalm/pull/13159) - Let release announcements be retried on some platforms only by [@&#8203;danog](https://github.com/danog) in [#&#8203;13160](https://github.com/vimeo/psalm/pull/13160) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.0.1...7.0.2> ### [`v7.0.1`](https://github.com/vimeo/psalm/releases/tag/7.0.1) [Compare Source](https://github.com/vimeo/psalm/compare/7.0.0...7.0.1) <!-- Release notes generated using configuration in .github/release.yml at c3909231356b5fce30739ff0cf62bf50e6b5e7c7 --> #### What's Changed ##### Fixes - Report each property write in a restricted purity context once by [@&#8203;danog](https://github.com/danog) in [#&#8203;13067](https://github.com/vimeo/psalm/pull/13067) - \[7.x] Cut peak memory 22 to 25% (4.6 to 3.6 GB on Laravel) by stopping workers before unpacking their results by [@&#8203;jarstelfox](https://github.com/jarstelfox) in [#&#8203;12573](https://github.com/vimeo/psalm/pull/12573) - Fix: code used only from `__destruct` and other magic methods is reported unused by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13069](https://github.com/vimeo/psalm/pull/13069) - Don't report strtolower() of a Stringable object as redundant by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12598](https://github.com/vimeo/psalm/pull/12598) - Fix: `__callStatic` and the code it uses reported unused by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13073](https://github.com/vimeo/psalm/pull/13073) - Don't crash on a constant dividing by a zero constant of another class ([#&#8203;12066](https://github.com/vimeo/psalm/issues/12066)) by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12761](https://github.com/vimeo/psalm/pull/12761) - fix(readonly): promoted properties of a readonly class are readonly by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12909](https://github.com/vimeo/psalm/pull/12909) - fix(var-docblock): a [@&#8203;var](https://github.com/var) line without a name does not take the name of the previous line by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12670](https://github.com/vimeo/psalm/pull/12670) - fix(messages): say that the (unset) cast was removed in PHP 8.0 by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12824](https://github.com/vimeo/psalm/pull/12824) - fix(messages): explain impossible negated checks and calls without effect by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13006](https://github.com/vimeo/psalm/pull/13006) - fix(types): array intersected with iterable is an array of the iterable's types by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;13004](https://github.com/vimeo/psalm/pull/13004) - fix(messages): do not tell to install a polyfill that may not ship the symbol by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12813](https://github.com/vimeo/psalm/pull/12813) ##### Docs - Document that taint analysis runs by default by [@&#8203;roxblnfk](https://github.com/roxblnfk) in [#&#8203;13072](https://github.com/vimeo/psalm/pull/13072) ##### Internal changes - Add regression tests for 92 issues already fixed in Psalm 7 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13063](https://github.com/vimeo/psalm/pull/13063) - Let a Psalm process of the end-to-end tests run for 300 seconds by [@&#8203;jirkace](https://github.com/jirkace) in [#&#8203;12613](https://github.com/vimeo/psalm/pull/12613) - Push the files composer build regenerates instead of failing by [@&#8203;danog](https://github.com/danog) in [#&#8203;13138](https://github.com/vimeo/psalm/pull/13138) #### New Contributors - [@&#8203;roxblnfk](https://github.com/roxblnfk) made their first contribution in [#&#8203;13072](https://github.com/vimeo/psalm/pull/13072) **Full Changelog**: <https://github.com/vimeo/psalm/compare/7.0.0...7.0.1> ### [`v7.0.0`](https://github.com/vimeo/psalm/releases/tag/7.0.0): Psalm 7 [Compare Source](https://github.com/vimeo/psalm/compare/6.21.4...7.0.0) ### Psalm 7 Announcing the release of Psalm 7! Featuring a simply enormous number of new features and bug fixes, such as: - **security analysis on by default**: fully refactored for 10x+ performance and much greater coverage, in the same run as type checking and dead code detection; - **much deeper security analysis taint tracking**: NoSQL, LLM prompt and URL injection, new sources like `php://input` and uploaded file names, flows through closures, generators, traits and by-reference parameters, and ready-made stubs for Guzzle, PSR-7, Monolog, MongoDB and more. - **a new purity model** based on Hack's capabilities: declare exactly which side effects a function may have (`io`, `time`, `write-props`...), with purity templates for classes, closures and automatically inferred annotations; - **graph-based dead code detection**: If nothing reachable uses a class, function, method, constant, variable, etc, Psalm finds it, now properly handling unused cycles as well. - **Template defaults** (`@template TError of Throwable = RuntimeException`) for classes, functions and methods: `Result<int>` just works, and libraries can add templates without breaking their users. - **PHP 8.5 and 8.6 support**: Full support for Partial Function Application, the pipe operator, and much more! - **Daily releases.** Features and fixes reach you the day they land, no more waiting on `dev-master`. - **Framework plugins in the box.** The PHPUnit, Symfony, Laravel, Mockery and sabre/event plugins ship with Psalm and switch on by themselves. Zero setup. - **a bigger Psalm maintainer team**: [@&#8203;alies-dev](https://github.com/alies-dev) has joined the Psalm maintainer team, contributing many new useful features and bugfixes! - **An official [Discord community!](https://discord.gg/RwH8rEpxt9)** - **And so, so many other new features and bugfixes!** Psalm 7 runs on 64-bit PHP 8.2 to 8.6. Upgrading is simple for most projects: see [Upgrading](#upgrading) below. #### Security analysis: faster, always on, in a single run Taints are now stored as a bitmask, and the taint graph is resolved over compact summaries of each function. This makes security analysis up to **10x faster**. **Combined analysis** ([#&#8203;11384](https://github.com/vimeo/psalm/issues/11384)) runs type checking, security analysis and dead code detection together in one run, so **taint analysis is now on by default** ([#&#8203;11399](https://github.com/vimeo/psalm/issues/11399)). Taint issues are reported with a `SECURITY` severity, and with a rank in SARIF reports ([#&#8203;12068](https://github.com/vimeo/psalm/issues/12068), [#&#8203;11383](https://github.com/vimeo/psalm/issues/11383)). The results no longer change between runs or with the thread count ([#&#8203;11946](https://github.com/vimeo/psalm/issues/11946), [#&#8203;11952](https://github.com/vimeo/psalm/issues/11952), [#&#8203;11953](https://github.com/vimeo/psalm/issues/11953)). #### Deeper taint tracking ```php <?php $run = function (string $c): void { shell_exec($c); }; $run((string) $_GET['cmd']); // TaintedShell, through the closure $mongo = new MongoDB\Driver\Manager('mongodb://localhost'); $mongo->executeQuery('db.users', new MongoDB\Driver\Query(['name' => $_GET['name']])); // TaintedNosql /** @return mixed */ function body() { return json_decode((string) file_get_contents('php://input'), true); } eval((string) body()); // TaintedEval: php://input is a source ``` **[Try it on psalm.dev »](https://psalm.dev/r/7631291cc5)** - **New taint kinds:** [`TaintedNosql`](https://psalm.dev/docs/running_psalm/issues/TaintedNosql/) (MongoDB sinks), [`TaintedLlmPrompt`](https://psalm.dev/docs/running_psalm/issues/TaintedLlmPrompt/) (prompt injection), and [`TaintedUrlComponent`](https://psalm.dev/docs/running_psalm/issues/TaintedUrlComponent/) / [`TaintedUrlPath`](https://psalm.dev/docs/running_psalm/issues/TaintedUrlPath/) (query and path injection). curl options and `CURLFile` are reported by what they do: SSRF, header injection, file access, sleep or callables. [Every taint type is now documented](https://psalm.dev/docs/security_analysis/) ([#&#8203;11944](https://github.com/vimeo/psalm/issues/11944), [#&#8203;11746](https://github.com/vimeo/psalm/issues/11746), [#&#8203;12097](https://github.com/vimeo/psalm/issues/12097), [#&#8203;12099](https://github.com/vimeo/psalm/issues/12099), [#&#8203;12468](https://github.com/vimeo/psalm/issues/12468)). - **New sources:** `php://input`, `STDIN`, the client-sent entries of `$_SERVER` and `$_FILES`, `getopt()`, `$argv`, DNS answers, exception messages, and the files, paths and URLs builtins read ([#&#8203;11945](https://github.com/vimeo/psalm/issues/11945), [#&#8203;12086](https://github.com/vimeo/psalm/issues/12086), [#&#8203;12246](https://github.com/vimeo/psalm/issues/12246), [#&#8203;12245](https://github.com/vimeo/psalm/issues/12245), [#&#8203;12135](https://github.com/vimeo/psalm/issues/12135), [#&#8203;12139](https://github.com/vimeo/psalm/issues/12139)). - **Taint now flows through** closures and callable parameters, generators and iterators, by-reference parameters, `foreach` by reference, global and static variables, trait method bodies, promoted constructor properties, `__toString()`, inherited methods and their overrides, exceptions, and builtin functions and objects ([#&#8203;12147](https://github.com/vimeo/psalm/issues/12147), [#&#8203;12096](https://github.com/vimeo/psalm/issues/12096), [#&#8203;12095](https://github.com/vimeo/psalm/issues/12095), [#&#8203;12121](https://github.com/vimeo/psalm/issues/12121), [#&#8203;12243](https://github.com/vimeo/psalm/issues/12243), [#&#8203;12255](https://github.com/vimeo/psalm/issues/12255), [#&#8203;12272](https://github.com/vimeo/psalm/issues/12272), [#&#8203;12091](https://github.com/vimeo/psalm/issues/12091), [#&#8203;12127](https://github.com/vimeo/psalm/issues/12127), [#&#8203;12262](https://github.com/vimeo/psalm/issues/12262), [#&#8203;12084](https://github.com/vimeo/psalm/issues/12084), [#&#8203;12102](https://github.com/vimeo/psalm/issues/12102)). - **Fewer false positives:** taints a type can't carry are removed (an `int` has no `html` taint). Array keys are tracked much more precisely. Inferred-pure functions are specialized per call, and `@psalm-cli-only` marks code whose output isn't an HTML response ([#&#8203;12079](https://github.com/vimeo/psalm/issues/12079), [#&#8203;12348](https://github.com/vimeo/psalm/issues/12348), [#&#8203;12150](https://github.com/vimeo/psalm/issues/12150), [#&#8203;12375](https://github.com/vimeo/psalm/issues/12375), [#&#8203;12048](https://github.com/vimeo/psalm/issues/12048), [#&#8203;12459](https://github.com/vimeo/psalm/issues/12459)). - **Library stubs:** Psalm ships taint and purity stubs for Guzzle, PSR-7, PSR-18, psr/log, Monolog, mongodb/mongodb, amphp (http-client, byte-stream, file, process), phpClickHouse, PhpSpreadsheet, Archive_Tar, php-vips, webklex/php-imap and webmozart/assert. A stub is loaded only when your code uses the library ([`loadLibraryStubs`](https://psalm.dev/docs/running_psalm/configuration/#loadlibrarystubs), on by default) ([#&#8203;12460](https://github.com/vimeo/psalm/issues/12460)–[#&#8203;12467](https://github.com/vimeo/psalm/issues/12467), [#&#8203;12481](https://github.com/vimeo/psalm/issues/12481)–[#&#8203;12484](https://github.com/vimeo/psalm/issues/12484)). - **More expressive annotations** ([docs](https://psalm.dev/docs/security_analysis/annotations/)): - conditional sinks: `@psalm-taint-sink ($mode is 0 ? null : 'html') $content` ([#&#8203;12458](https://github.com/vimeo/psalm/issues/12458)); - sinks on array values only: `@psalm-taint-sink sql $params[*]` ([#&#8203;12171](https://github.com/vimeo/psalm/issues/12171)); - sources under one key of the return value: `@psalm-taint-source input return['key']` ([#&#8203;12455](https://github.com/vimeo/psalm/issues/12455)); - taint complements: `~(html|has_quotes)` ([#&#8203;12300](https://github.com/vimeo/psalm/issues/12300)); - `@psalm-flow` through callables (`($compute()) -> return`), the receiver (`($this) -> return`), `$this` properties, and keyed stores (`($value) -> Store::$data[$key]`) ([#&#8203;12299](https://github.com/vimeo/psalm/issues/12299), [#&#8203;12302](https://github.com/vimeo/psalm/issues/12302), [#&#8203;12456](https://github.com/vimeo/psalm/issues/12456), [#&#8203;12312](https://github.com/vimeo/psalm/issues/12312), [#&#8203;12327](https://github.com/vimeo/psalm/issues/12327)); - `@psalm-taint-property-bag` ([#&#8203;12486](https://github.com/vimeo/psalm/issues/12486)); - custom taints declared in `psalm.xml` ([#&#8203;12330](https://github.com/vimeo/psalm/issues/12330)). - **Plugin API for taints:** `Codebase::getTaintNode()`, `getTaintPropertyNode()`, `addTaintPath()`, `getReceiverTaintPath()`, and the taint nodes of a call's return value, arguments and receiver ([#&#8203;12454](https://github.com/vimeo/psalm/issues/12454), [#&#8203;12414](https://github.com/vimeo/psalm/issues/12414), [#&#8203;12489](https://github.com/vimeo/psalm/issues/12489), [#&#8203;12535](https://github.com/vimeo/psalm/issues/12535)). #### A new purity model: capabilities `@psalm-pure`, `@psalm-mutation-free` and `@psalm-external-mutation-free` are replaced by **capabilities**, modelled on [Hack's contexts and capabilities](https://docs.hhvm.com/hack/contexts-and-capabilities/introduction). A function-like declares exactly which side effects it may have: `read-props`, `write-this-props`, `write-props`, `read-globals`, `write-globals`, `write-refs`, `io` and `time`, with `pure` and `impure` at the two ends ([#&#8203;11984](https://github.com/vimeo/psalm/issues/11984)): ```php <?php /** @psalm-capabilities time */ function today(): string { return date('Y-m-d'); // no issue } /** @psalm-pure */ function todayWrong(): string { return date('Y-m-d'); // ImpureFunctionCall: ... requires time } ``` **[Try it on psalm.dev »](https://psalm.dev/r/be7eb39420)** - Psalm **infers purity across the call graph**. Where an annotation could be added, it can suggest one: set `<psalm suggestPurityAnnotations="true">` to get `MissingPureAnnotation` and `MissingImmutableAnnotation` (and their abstract and interface variants), and run `--alter --issues=MissingPureAnnotation,MissingImmutableAnnotation` to add the annotations. The `--alter` command works without the attribute. The suggestions are opt-in. - Pure and read-only functions are **taint-specialized automatically**, so annotating your code also removes false positives from security analysis. - Builtins, SPL, the Random, phpredis and MongoDB extensions and more declare what they do. - `clone`, `__toString()`, `__invoke()`, `ArrayAccess`, destructors, `new $class` and parameter defaults are now checked too. - `@psalm-pure` can be used on classes, and plugins can declare the capabilities of the methods they handle. The new [Purity Model](https://psalm.dev/docs/annotating_code/purity_model/) article explains the model in full. #### Purity templates Many functions are only as pure as what they are given: `array_map()` is pure when its callback is. **Purity templates** are template parameters whose values are capability sets instead of types, like Hack's `[ctx $f]` contexts. A function can now be both pure and higher-order, and each call costs only what its arguments do ([#&#8203;11984](https://github.com/vimeo/psalm/issues/11984)). With `Closure[_]`, a function takes its purity from the closure it is given: ```php <?php /** * @psalm-pure * @param Closure[_](int): int $f */ function apply(Closure $f, int $x): int { return $f($x); } /** @psalm-pure */ function double(int $x): int { return apply(fn(int $y): int => $y * 2, $x); // no issue: the closure is pure } /** @psalm-pure */ function noisy(int $x): int { return apply(function (int $y): int { echo $y; return $y; }, $x); // ImpureFunctionCall: The context is pure but function call on apply requires io } /** @psalm-pure */ function lengths(array $words): array { return array_map(fn(string $w): int => strlen($w), $words); // no issue: builtins taking callbacks work the same way } ``` On a class, a purity template lets each subclass decide what its methods may do: ```php <?php /** @psalm-purity-template P */ abstract class Handler { /** * @psalm-pure * @psalm-purity-from-template P */ abstract public function handle(string $input): string; } /** @extends Handler[pure] */ final class Upper extends Handler { /** @psalm-pure */ #[Override] public function handle(string $input): string { return strtoupper($input); } } /** @extends Handler[io] */ final class Printer extends Handler { /** @psalm-capabilities io */ #[Override] public function handle(string $input): string { echo $input; return $input; } } /** @psalm-pure */ function viaUpper(Upper $handler): string { return $handler->handle('a'); // no issue: Upper binds P to pure } /** @psalm-pure */ function viaPrinter(Printer $handler): string { return $handler->handle('a'); // ImpureMethodCall: The context is pure but method Printer::handle requires io } ``` `Traversable`, `Iterator`, `IteratorAggregate` and `Generator` have a purity template, for what iterating over them does. `iterable` has one too. A generator with a purity annotation binds it to what its body does: ```php <?php /** * @psalm-pure * @param Traversable[pure]<int, int> $xs */ function sum(Traversable $xs): int { $total = 0; foreach ($xs as $x) { // no issue $total += $x; } return $total; } /** * @psalm-pure * @param Traversable<int, int> $xs */ function sumAny(Traversable $xs): int { $total = 0; foreach ($xs as $x) { // ImpureMethodCall: The context is pure but iterating over Traversable<int, int> requires impure $total += $x; } return $total; } /** * @psalm-pure * @return Generator<int, int> */ function numbers(): Generator { yield 1; yield 2; } /** @psalm-pure */ function total(): int { return sum(numbers()); // no issue: numbers() returns a Generator[pure] } ``` - **Syntax:** purity arguments go in square brackets before the type arguments, as in Hack: `Closure[io](int): void`, `Handler[pure]`, `Iterator[pure]<int, string>`, `Box[io]<int>`. Named templates are declared with `@psalm-purity-template P` and used with `@psalm-purity-from-template P`. - **Bounds and defaults** are written as a chain: `@psalm-purity-template write-this-props <= C(write-this-props) <= write-this-props|write-props|io`. A method may use the lower bound unconditionally. Subclasses must stay within the bounds, and get the default when they don't bind the template. - **Constructors** can bind a class template from their arguments, with a `Closure[P]` parameter or a conditional `@return` on `__construct`. For example, `new ArrayObject([...])` is an `ArrayObject[pure]`, so a pure function may fill an `ArrayObject` it created ([#&#8203;12116](https://github.com/vimeo/psalm/issues/12116), [#&#8203;12179](https://github.com/vimeo/psalm/issues/12179), [#&#8203;12190](https://github.com/vimeo/psalm/issues/12190)). - Purity templates are checked across **overrides, traits and closures** nested in a templated scope ([#&#8203;12015](https://github.com/vimeo/psalm/issues/12015), [#&#8203;12126](https://github.com/vimeo/psalm/issues/12126), [#&#8203;12027](https://github.com/vimeo/psalm/issues/12027)). - **Inferred too:** Psalm infers the purity of calls to templated functions, and `--alter` adds `Closure[_]` to the closure parameters a function calls ([#&#8203;12077](https://github.com/vimeo/psalm/issues/12077), [#&#8203;12019](https://github.com/vimeo/psalm/issues/12019)). - **Builtins and SPL** taking callbacks or iterators are declared with purity templates: `array_map`, `usort`, `preg_replace_callback`, `iterator_to_array`, `CallbackFilterIterator`, `Fiber` and more ([#&#8203;12122](https://github.com/vimeo/psalm/issues/12122)). See [Purity templates](https://psalm.dev/docs/annotating_code/purity_model/#purity-templates) in the Purity Model article. #### Graph-based dead code detection Unused code is now found on a graph of references ([#&#8203;11939](https://github.com/vimeo/psalm/issues/11939)). Code is used only if it can be reached from an entry point, so classes and methods referenced only by other unused code, cycles included, are reported. Exceptions that are created but never thrown are reported too ([#&#8203;12487](https://github.com/vimeo/psalm/issues/12487)): ```php <?php final class Service { public function run(int $id): void { if ($id < 0) { new InvalidArgumentException('negative id'); // UnusedMethodCall: ... never thrown or used } echo $id; } } final class Ping { // UnusedClass public static function ping(): void { Pong::pong(); } } final class Pong { // UnusedClass public static function pong(): void { Ping::ping(); } } (new Service())->run(1); ``` **[Try it on psalm.dev »](https://psalm.dev/r/31c62c069b)** `--find-unused-psalm-suppress` now also checks suppressions on classes and on `Tainted*` issues. #### Type system - **Template defaults:** a template can declare a default type, `@template T = Default` or `@template T of Bound = Default`, on classes, interfaces, traits, functions and methods. Psalm uses it when the type argument is left out: in `@extends`/`@implements`/`@use`, in a generic type with only its first arguments (`Result<int>`), in `new`, and in calls that don't infer the template. Libraries can add a template without breaking every `Foo<A>` their users wrote, and those users no longer get `MissingTemplateParam`. See [Template defaults](https://psalm.dev/docs/annotating_code/templated_annotations/#template-defaults). ```php <?php /** * @template TValue * @template TError of Throwable = RuntimeException */ final class Result { /** @var TError|null */ public ?Throwable $error = null; } /** @param Result<int> $result */ function handle(Result $result): void { $error = $result->error; // RuntimeException|null (Psalm 6: MissingTemplateParam, Throwable|null) } /** @template T */ interface Option { /** * @template TResult = T * @param (callable(T): TResult)|null $map * @return Option<TResult> */ public function map(?callable $map = null): Option; } /** @param Option<int> $option */ function check(Option $option): void { $same = $option->map(); // Option<int> (Psalm 6: Option<never>) } ``` **[Try it on psalm.dev »](https://psalm.dev/r/4e21eb262e)** - New types and syntax: `decimal-int-string` and `non-decimal-int-string`, global constant wildcards, conditional types on types that depend on a template, `is not` in conditional types, and exact intersections of scalar and conditional types. - Constructor `@return` types. - New [`IntMaskComparison`](https://psalm.dev/docs/running_psalm/issues/IntMaskComparison/) issue for int-masks compared by value. #### PHP 8.5 and 8.6 - Psalm runs on PHP 8.6 and has a PHP 8.6 call map. - The PHP 8.5 pipe operator and PHP 8.6 partial function application are fully typed: Psalm infers the type of every pipeline stage and the signature of every partially applied closure, so a stage that doesn't fit the previous one is reported : ```php <?php function slug(string $title): string { return $title |> trim(...) |> strtolower(...) |> str_replace(' ', '-', ?); // no issue: each stage is typed } function lowercaseWords(string $title): string { return $title |> explode(' ', ?) |> strtolower(...); // InvalidArgument: Argument 1 of strtolower expects string, but non-empty-list<string> provided } function wrongLength(string $title): string { return $title |> trim(...) |> strlen(...); // InvalidReturnStatement: 'int<0, max>' does not match 'string' } ``` **[Try it on psalm.dev »](https://psalm.dev/r/3c08a570e0)** #### Plugins - **Versioned plugin API:** Psalm's version number no longer tracks the plugin API. **Breaking changes to the plugin API may ship in any Psalm release, including minor and patch releases.** The [psalm/psalm-plugin-api](https://packagist.org/packages/psalm/psalm-plugin-api) metapackage tracks them instead ([#&#8203;11739](https://github.com/vimeo/psalm/issues/11739)). Its major version is bumped for every breaking change, and its readme lists the changes. Plugins should require it with a caret range (`^0.4`): Composer will then only install the plugin with a Psalm release whose plugin API it was written for. - **Bundled plugins:** Psalm requires `psalm/plugin-phpunit`, `plugin-mockery`, `plugin-symfony`, `plugin-laravel` and `plugin-sabre-event`, and enables each one, plus the webmozart/assert plugin, when your `composer.json` uses the matching library ([`loadLibraryPlugins`](https://psalm.dev/docs/running_psalm/configuration/#loadlibraryplugins), on by default) ([#&#8203;12568](https://github.com/vimeo/psalm/issues/12568), [#&#8203;12570](https://github.com/vimeo/psalm/issues/12570), [#&#8203;12571](https://github.com/vimeo/psalm/issues/12571)). - Plugin issues can have custom documentation URLs, and respect `ERROR_LEVEL` ([#&#8203;11735](https://github.com/vimeo/psalm/issues/11735), [#&#8203;11736](https://github.com/vimeo/psalm/issues/11736)). #### CLI and configuration - `--init-ci` generates a GitHub Actions workflow that runs the official Docker image, pinned to the Psalm version in your `composer.lock`. The docs now cover the [Psalm GitHub Action](https://github.com/psalm/psalm-github-actions) and the [Psalm Security Scan](https://github.com/psalm/psalm-github-security-scan) action, which sends security analysis results to GitHub code scanning. - The official Docker image is now `ghcr.io/psalm/psalm`. - The old `compact` output format is renamed `table`, and a new, truly compact `compact` format is added. - `<unsuppressibleIssues>` makes the issues it lists impossible to suppress. - Faster startup: less scanning, and single-file scans no longer build the full project file list. Composer's autoloader is no longer deep-scanned. - More detailed progress output, including for taint graph resolution, and short, actionable CLI messages. #### Upgrading For most projects, upgrading is as simple as updating the Composer dependency: ```bash composer require --dev vimeo/psalm:^7.0 -W ``` Everything else is in the [upgrade guide](https://psalm.dev/docs/running_psalm/upgrading_to_psalm_7/). Most projects will notice: - **Taint analysis runs by default.** Set `runTaintAnalysis="false"` to opt out. - If enabled via `<psalm suggestPurityAnnotations="true">`, **new `MissingPureAnnotation`/`MissingImmutableAnnotation` issues** appear for code that can be annotated. Fix them with `--alter --issues=MissingPureAnnotation,MissingImmutableAnnotation`. The annotations Psalm adds improve both security analysis and type inference: - **Fewer security false positives:** Psalm specializes the taints of calls to pure and read-only functions and methods per call site. Tainted input passed at one call then no longer taints the result of every other call. Without annotations, Psalm can only infer this for functions and methods that can't be overridden. - **Better type inference:** Psalm remembers the results of methods of immutable classes between calls, so `$a->get() !== null ? $a->get() : ''` is a `string`. Without `@psalm-immutable`, the second call is still `?string`. - **Checked contracts:** pure code can call the annotated functions, and every override and implementation is checked not to do more than the annotation allows. #### Thanks Thanks to everyone who contributed to Psalm 7, and to everyone who tested the betas and release candidates and reported issues! **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.3...7.0.0> ### [`v6.21.4`](https://github.com/vimeo/psalm/releases/tag/6.21.4) [Compare Source](https://github.com/vimeo/psalm/compare/6.21.3...6.21.4) <!-- Release notes generated using configuration in .github/release.yml at 72023213487628df0bc5b2e02d68cbac614b7ef5 --> #### What's Changed ##### Fixes - \[6.x] Fork workers with the StreamSelectDriver event loop by [@&#8203;zonuexe](https://github.com/zonuexe) in [#&#8203;14750](https://github.com/vimeo/psalm/pull/14750) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.21.3...6.21.4> ### [`v6.21.3`](https://github.com/vimeo/psalm/releases/tag/6.21.3) [Compare Source](https://github.com/vimeo/psalm/compare/6.21.2...6.21.3) <!-- Release notes generated using configuration in .github/release.yml at 9fbfcc145eef219e602fa7cded83faf79fe20ffc --> #### What's Changed ##### Fixes - fix: class-string with template contains non-object type by [@&#8203;vincent4vx](https://github.com/vincent4vx) in [#&#8203;11755](https://github.com/vimeo/psalm/pull/11755) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.21.2...6.21.3> ### [`v6.21.2`](https://github.com/vimeo/psalm/releases/tag/6.21.2) [Compare Source](https://github.com/vimeo/psalm/compare/6.21.1...6.21.2) <!-- Release notes generated using configuration in .github/release.yml at 7c854e9a39b14e49552cb949829abc36c16c866f --> #### What's Changed ##### Fixes - \[6.x] Fix: false `AmbiguousConstantInheritance` for a constant reached through a parent class and an interface by [@&#8203;Aerendir](https://github.com/Aerendir) in [#&#8203;12663](https://github.com/vimeo/psalm/pull/12663) #### New Contributors - [@&#8203;Aerendir](https://github.com/Aerendir) made their first contribution in [#&#8203;12663](https://github.com/vimeo/psalm/pull/12663) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.21.1...6.21.2> ### [`v6.21.1`](https://github.com/vimeo/psalm/releases/tag/6.21.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.21.0...6.21.1) <!-- Release notes generated using configuration in .github/release.yml at ecd8c23829dd6527337f0f72790c7f894a1a3d0e --> #### What's Changed ##### Fixes - Fix iterable union containment and conditional type inference by [@&#8203;andrew-demb](https://github.com/andrew-demb) in [#&#8203;13329](https://github.com/vimeo/psalm/pull/13329) - \[6.x] Preserve set visibility when reflecting properties by [@&#8203;jturbide](https://github.com/jturbide) in [#&#8203;12052](https://github.com/vimeo/psalm/pull/12052) #### New Contributors - [@&#8203;jturbide](https://github.com/jturbide) made their first contribution in [#&#8203;12052](https://github.com/vimeo/psalm/pull/12052) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.21.0...6.21.1> ### [`v6.21.0`](https://github.com/vimeo/psalm/releases/tag/6.21.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.13...6.21.0) <!-- Release notes generated using configuration in .github/release.yml at ef1458bf94f30be89ef01278265f846b254248cb --> #### What's Changed ##### Features - Add support for reading inheritors from a phpstan-sealed tag by [@&#8203;stof](https://github.com/stof) in [#&#8203;11818](https://github.com/vimeo/psalm/pull/11818) ##### Fixes - Psalm used wrong autoloader from parent directory in monorepos by [@&#8203;kkmuffme](https://github.com/kkmuffme) in [#&#8203;11698](https://github.com/vimeo/psalm/pull/11698) - Allow setting no params with provider by [@&#8203;kkmuffme](https://github.com/kkmuffme) in [#&#8203;11622](https://github.com/vimeo/psalm/pull/11622) - ImpureFunctionsList: Adding `curl_share_setopt`, `imap_timeout`, `imap_expunge` by [@&#8203;ThomasLandauer](https://github.com/ThomasLandauer) in [#&#8203;11858](https://github.com/vimeo/psalm/pull/11858) ##### Internal changes - Remove the baseline entry [#&#8203;11622](https://github.com/vimeo/psalm/issues/11622) made unused by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;14304](https://github.com/vimeo/psalm/pull/14304) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.13...6.21.0> ### [`v6.20.13`](https://github.com/vimeo/psalm/releases/tag/6.20.13) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.12...6.20.13) <!-- Release notes generated using configuration in .github/release.yml at 9dd07528c4f058df1572d40ab2db5c1566a728f2 --> #### What's Changed ##### Fixes - 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) ##### Internal changes - 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) #### New Contributors - [@&#8203;d-mitrofanov-v](https://github.com/d-mitrofanov-v) made their first contribution in [#&#8203;11586](https://github.com/vimeo/psalm/pull/11586) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.12...6.20.13> ### [`v6.20.12`](https://github.com/vimeo/psalm/releases/tag/6.20.12) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.11...6.20.12) <!-- Release notes generated using configuration in .github/release.yml at 56e5217b13db8789c2b8cfcc73d0f902df2cda11 --> #### What's Changed ##### 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) #### New Contributors - [@&#8203;wleeaf](https://github.com/wleeaf) made their first contribution in [#&#8203;12494](https://github.com/vimeo/psalm/pull/12494) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.11...6.20.12> ### [`v6.20.11`](https://github.com/vimeo/psalm/releases/tag/6.20.11) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.10...6.20.11) <!-- Release notes generated using configuration in .github/release.yml at fca8e037ed356b9fc1afc213902e82dfad418eba --> #### What's Changed ##### Fixes - \[6.x] Fix crash when a closure unsets a by-reference captured variable (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12058](https://github.com/vimeo/psalm/pull/12058) - \[6.x] Fix type variables bounded by another type variable (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12059](https://github.com/vimeo/psalm/pull/12059) - 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) - 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) - 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) - 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 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) - \[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) ##### Internal changes - 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) #### New Contributors - [@&#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/6.20.10...6.20.11> ### [`v6.20.10`](https://github.com/vimeo/psalm/releases/tag/6.20.10) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.9...6.20.10) <!-- Release notes generated using configuration in .github/release.yml at 7fc81490f861c801061836a9010603d2393bf8da --> #### What's Changed ##### Fixes - :sparkles: \[[#&#8203;11509](https://github.com/vimeo/psalm/issues/11509)] Fix regression about iterables, list and conditional types by [@&#8203;andrew-demb](https://github.com/andrew-demb) in [#&#8203;11558](https://github.com/vimeo/psalm/pull/11558) ##### Internal changes - Fix 6.x CI: retry transient stub build failures, update array_first test by [@&#8203;danog](https://github.com/danog) in [#&#8203;13407](https://github.com/vimeo/psalm/pull/13407) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.9...6.20.10> ### [`v6.20.9`](https://github.com/vimeo/psalm/releases/tag/6.20.9) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.8...6.20.9) <!-- Release notes generated using configuration in .github/release.yml at f67170ac3c3b931f5088681e21d6c8babc601c08 --> #### What's Changed ##### Fixes - Fix LSP lookup of builtin functions in files not analyzed in-process by [@&#8203;M393](https://github.com/M393) in [#&#8203;13237](https://github.com/vimeo/psalm/pull/13237) - \[6.x] Infer return types for `array_first` and `array_last` (PHP 8.5) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12157](https://github.com/vimeo/psalm/pull/12157) - \[6.x] Infer the key parameter of `array_find`/`array_any`/`array_all` callbacks by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13245](https://github.com/vimeo/psalm/pull/13245) - \[6.x] Infer the exact element removed by `array_pop`/`array_shift` by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13246](https://github.com/vimeo/psalm/pull/13246) ##### Internal changes - Social medial: announce on X and Mastodon only the releases worth a post by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;13241](https://github.com/vimeo/psalm/pull/13241) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.8...6.20.9> ### [`v6.20.8`](https://github.com/vimeo/psalm/releases/tag/6.20.8) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.7...6.20.8) <!-- Release notes generated using configuration in .github/release.yml at 75d7ca00182ca690b273dcd8d172e8efa17d1f90 --> #### What's Changed ##### Internal changes - \[6.x] Push the files composer build regenerates instead of failing by [@&#8203;danog](https://github.com/danog) in [#&#8203;13147](https://github.com/vimeo/psalm/pull/13147) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.7...6.20.8> ### [`v6.20.7`](https://github.com/vimeo/psalm/releases/tag/6.20.7) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.6...6.20.7) <!-- Release notes generated using configuration in .github/release.yml at d60ecdbc9e577e67b29f632e3e3847dffd14b7ce --> #### What's Changed ##### Docs - Document the Psalm GitHub actions by [@&#8203;danog](https://github.com/danog) in [#&#8203;13051](https://github.com/vimeo/psalm/pull/13051) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.6...6.20.7> ### [`v6.20.6`](https://github.com/vimeo/psalm/releases/tag/6.20.6) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.5...6.20.6) <!-- Release notes generated using configuration in .github/release.yml at b1f67cc3c987b6ee22e2653eb0b6cd0a599dc3e0 --> #### What's Changed ##### Internal changes - CI: Make the perf PR comment and table more readable by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12922](https://github.com/vimeo/psalm/pull/12922) - Add guzzle/promises to the perf corpus by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12984](https://github.com/vimeo/psalm/pull/12984) - Push the docker image to ghcr.io/psalm/psalm by [@&#8203;danog](https://github.com/danog) in [#&#8203;13044](https://github.com/vimeo/psalm/pull/13044) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.5...6.20.6> ### [`v6.20.5`](https://github.com/vimeo/psalm/releases/tag/6.20.5) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.4...6.20.5) <!-- Release notes generated using configuration in .github/release.yml at e447b655502f2058630e6ee03f2ea1c3789fe166 --> #### What's Changed ##### Fixes - \[6.x] Treat New Relic PHP ext functions as impure and correct their signatures by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12293](https://github.com/vimeo/psalm/pull/12293) - Fix: psalm --init crash on non-existent composer autoload directories by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12659](https://github.com/vimeo/psalm/pull/12659) - \[6.x] Support `#[\DelayedTargetValidation]` (PHP 8.5) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12282](https://github.com/vimeo/psalm/pull/12282) - \[6.x] Fix: templated `@mixin` is ignored for property fetches by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12289](https://github.com/vimeo/psalm/pull/12289) - \[6.x] Fix: conditional return type in `@method` is not resolved by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12206](https://github.com/vimeo/psalm/pull/12206) - \[6.x] Fix crash on first-class callable static call forwarded through [@&#8203;mixin](https://github.com/mixin) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12133](https://github.com/vimeo/psalm/pull/12133) ##### Internal changes - Fix: PsalmRestarter restarts even when `opcache.jit` is already off by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12705](https://github.com/vimeo/psalm/pull/12705) - \[CI] Add a perf and issue-diff check over a pinned corpus of real projects by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12838](https://github.com/vimeo/psalm/pull/12838) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.4...6.20.5> ### [`v6.20.4`](https://github.com/vimeo/psalm/releases/tag/6.20.4) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.3...6.20.4) <!-- Release notes generated using configuration in .github/release.yml at e53db692e6600cf729c88190b892bcf96e1c550e --> #### What's Changed ##### Fixes - \[6.x] Fix: class_alias() of an enum, interface, attribute, trait or type holder crashes with Could not get class storage by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12518](https://github.com/vimeo/psalm/pull/12518) - \[6.x] Fix: type imported through a class_alias() is lost inside an intersection by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12569](https://github.com/vimeo/psalm/pull/12569) - \[6.x] Fix: accept TLiteralClassString of a trait as trait-string by [@&#8203;no-simpler](https://github.com/no-simpler) in [#&#8203;11783](https://github.com/vimeo/psalm/pull/11783) - \[6.x] Fix: false InvalidAttribute for `#[\Deprecated]` on traits (PHP 8.5) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12277](https://github.com/vimeo/psalm/pull/12277) - \[6.x] Narrow Redis keys(), hKeys() and hVals() to lists, declare RedisException and RedisClusterException by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12581](https://github.com/vimeo/psalm/pull/12581) - \[6.x] Fix crash on first-class callable of inherited method by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12582](https://github.com/vimeo/psalm/pull/12582) ##### Internal changes - \[6.x] Perf: update the reference cache once per analysis by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12575](https://github.com/vimeo/psalm/pull/12575) - Add a #psalm hashtag to release announcements by [@&#8203;danog](https://github.com/danog) in [#&#8203;12584](https://github.com/vimeo/psalm/pull/12584) #### New Contributors - [@&#8203;no-simpler](https://github.com/no-simpler) made their first contribution in [#&#8203;11783](https://github.com/vimeo/psalm/pull/11783) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.3...6.20.4> ### [`v6.20.3`](https://github.com/vimeo/psalm/releases/tag/6.20.3) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.2...6.20.3) <!-- Release notes generated using configuration in .github/release.yml at 23d217da099cc4a9a3bd03b644c1adf520022375 --> #### What's Changed ##### Fixes - \[6.x] Fix a \~600 MiB memory regression from 6.19.2 (nullsafe chain state on every node) by [@&#8203;jarstelfox](https://github.com/jarstelfox) in [#&#8203;12493](https://github.com/vimeo/psalm/pull/12493) ##### Internal changes - \[6.x] Install PECL extensions with PIE in the stub images by [@&#8203;danog](https://github.com/danog) in [#&#8203;12525](https://github.com/vimeo/psalm/pull/12525) - \[6.x] Don't cancel running stub builds on master and 6.x by [@&#8203;danog](https://github.com/danog) in [#&#8203;12530](https://github.com/vimeo/psalm/pull/12530) - Announce releases on Mastodon, X and Telegram by [@&#8203;danog](https://github.com/danog) in [#&#8203;12516](https://github.com/vimeo/psalm/pull/12516) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.2...6.20.3> ### [`v6.20.2`](https://github.com/vimeo/psalm/releases/tag/6.20.2) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.1...6.20.2) <!-- Release notes generated using configuration in .github/release.yml at 0706376ff62923efb11946b74bcb4be35daf8e7d --> #### What's Changed ##### Fixes - Analyse traits declared inside a namespace by [@&#8203;ybai08](https://github.com/ybai08) in [#&#8203;12498](https://github.com/vimeo/psalm/pull/12498) - \[6.x] Fix: mixed variable stays narrowed after an if with an && instanceof condition by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12503](https://github.com/vimeo/psalm/pull/12503) - \[6.x] Fix: classes of a real file lose sealAllMethods when a stub extends one of them by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12501](https://github.com/vimeo/psalm/pull/12501) - \[6.x] Cut cold-run memory \~40% (7.0 to 4.0 GiB) when arrayCache="false" by [@&#8203;jarstelfox](https://github.com/jarstelfox) in [#&#8203;12492](https://github.com/vimeo/psalm/pull/12492) ##### Internal changes - \[6.x] Pin grpc to 1.84.0 in the PHP 7.1 stub image by [@&#8203;danog](https://github.com/danog) in [#&#8203;12512](https://github.com/vimeo/psalm/pull/12512) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.1...6.20.2> ### [`v6.20.1`](https://github.com/vimeo/psalm/releases/tag/6.20.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.20.0...6.20.1) <!-- Release notes generated using configuration in .github/release.yml at 376425b8e67b79773add388e16b4f6be5693dc87 --> #### What's Changed ##### Fixes - \[6.x] Keep config untouched when `--set-baseline` runs with `--use-baseline` by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12385](https://github.com/vimeo/psalm/pull/12385) ##### Internal changes - Release master and 6.x every hour when all their checks passed by [@&#8203;danog](https://github.com/danog) in [#&#8203;12423](https://github.com/vimeo/psalm/pull/12423) ##### Other changes - Fix crash and lost aliases for interfaces declared with class_alias() by [@&#8203;Hoticus](https://github.com/Hoticus) in [#&#8203;12294](https://github.com/vimeo/psalm/pull/12294) - \[6.x] Fix crash when destructuring into offsets of an undefined variable by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11996](https://github.com/vimeo/psalm/pull/11996) - \[6.x] Apply --threads to the scan phase when --scan-threads is not given by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12382](https://github.com/vimeo/psalm/pull/12382) - \[6.x] Resolve `self` and `parent` in `@param-out` against the declaring class by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12391](https://github.com/vimeo/psalm/pull/12391) - \[6.x] Fix: crash on unknown [@&#8203;psalm-](https://github.com/psalm-) tags in property, constant and enum case docblocks by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12394](https://github.com/vimeo/psalm/pull/12394) - \[6.x] Fix: resolve templates and conditional returns in method keys seeded by assertions by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12392](https://github.com/vimeo/psalm/pull/12392) - \[6.x] Resolve object-shape properties on intersections with mixin or final classes by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12111](https://github.com/vimeo/psalm/pull/12111) - Do not report PropertyNotSetInConstructor for virtual hooked properties by [@&#8203;ybai08](https://github.com/ybai08) in [#&#8203;12404](https://github.com/vimeo/psalm/pull/12404) - Read [@&#8203;phpstan-require-extends](https://github.com/phpstan-require-extends) and [@&#8203;phpstan-require-implements](https://github.com/phpstan-require-implements) by [@&#8203;ybai08](https://github.com/ybai08) in [#&#8203;12403](https://github.com/vimeo/psalm/pull/12403) #### New Contributors - [@&#8203;Hoticus](https://github.com/Hoticus) made their first contribution in [#&#8203;12294](https://github.com/vimeo/psalm/pull/12294) - [@&#8203;ybai08](https://github.com/ybai08) made their first contribution in [#&#8203;12404](https://github.com/vimeo/psalm/pull/12404) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.20.0...6.20.1> ### [`v6.20.0`](https://github.com/vimeo/psalm/releases/tag/6.20.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.19.2...6.20.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - \[6.x] Add generic stubs for the PHP 8.4 Dom\ API by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12231](https://github.com/vimeo/psalm/pull/12231) ##### Internal changes - Fix macOS CI: bump setup-php to 2.40.0 by [@&#8203;danog](https://github.com/danog) in [#&#8203;12296](https://github.com/vimeo/psalm/pull/12296) ##### Other changes - Fix: Psalter crash on bodyless methods with a return type by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12221](https://github.com/vimeo/psalm/pull/12221) - Fix: dispatch AfterCodebasePopulated from Psalter and the language server by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12235](https://github.com/vimeo/psalm/pull/12235) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.19.2...6.20.0> ### [`v6.19.2`](https://github.com/vimeo/psalm/releases/tag/6.19.2) [Compare Source](https://github.com/vimeo/psalm/compare/6.19.1...6.19.2) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - \[6.x] Report string increments as deprecated since PHP 8.5 (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12062](https://github.com/vimeo/psalm/pull/12062) - Support generic exception classes in [@&#8203;throws](https://github.com/throws) by [@&#8203;orcnd](https://github.com/orcnd) in [#&#8203;12090](https://github.com/vimeo/psalm/pull/12090) ##### Fixes - \[6.x] Fix implode() inferring non-empty-string for possibly empty elements (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12054](https://github.com/vimeo/psalm/pull/12054) - \[6.x] Fix: respect ERROR_LEVEL for plugin-defined issues (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12060](https://github.com/vimeo/psalm/pull/12060) - \[6.x] Fix InvalidCast when casting a type variable to string (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12055](https://github.com/vimeo/psalm/pull/12055) - \[6.x] Fix crash on multibyte literal haystack on PHP 8.5 (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12053](https://github.com/vimeo/psalm/pull/12053) - \[6.x] Support parenthesized union types in [@&#8203;method](https://github.com/method) parameters (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12057](https://github.com/vimeo/psalm/pull/12057) - \[6.x] Resolve `parent::` first-class callables of `@method` pseudo-methods by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12148](https://github.com/vimeo/psalm/pull/12148) - \[6.x] Fix: type aliases depend on declaration order by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12149](https://github.com/vimeo/psalm/pull/12149) - Reset $\_SESSION after session_unset() by [@&#8203;TheNetherWatcher](https://github.com/TheNetherWatcher) in [#&#8203;12087](https://github.com/vimeo/psalm/pull/12087) - \[6.x] Model nullsafe short-circuiting across the whole chain by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12064](https://github.com/vimeo/psalm/pull/12064) ##### Docs - \[6.x] Docs: clearer UnusedParam example and --config usage (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12063](https://github.com/vimeo/psalm/pull/12063) - Docs: mention that findUnusedCode is on by default in v6 by [@&#8203;TheNetherWatcher](https://github.com/TheNetherWatcher) in [#&#8203;12085](https://github.com/vimeo/psalm/pull/12085) ##### Internal changes - \[6.x] Allow plugin issues to specify custom documentation URLs (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12061](https://github.com/vimeo/psalm/pull/12061) ##### Other changes - Fix LSP lookup of functions declared in included files by [@&#8203;M393](https://github.com/M393) in [#&#8203;12080](https://github.com/vimeo/psalm/pull/12080) #### New Contributors - [@&#8203;orcnd](https://github.com/orcnd) made their first contribution in [#&#8203;12090](https://github.com/vimeo/psalm/pull/12090) - [@&#8203;TheNetherWatcher](https://github.com/TheNetherWatcher) made their first contribution in [#&#8203;12085](https://github.com/vimeo/psalm/pull/12085) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.19.1...6.19.2> ### [`v6.19.1`](https://github.com/vimeo/psalm/releases/tag/6.19.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.19.0...6.19.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Keep polyfills of newer native functions out of the global functions on cached runs by [@&#8203;danog](https://github.com/danog) in [#&#8203;12025](https://github.com/vimeo/psalm/pull/12025) - \[6.x] Allow asymmetric visibility on static properties in PHP 8.5 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12035](https://github.com/vimeo/psalm/pull/12035) - Fix: ReflectionClass template became invariant on PHP 8.4 by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;12036](https://github.com/vimeo/psalm/pull/12036) - Fix crash on static property fetch via builtin class string by [@&#8203;HenkPoley](https://github.com/HenkPoley) in [#&#8203;12038](https://github.com/vimeo/psalm/pull/12038) - Check `$class::$prop` reads and assignments when the class is a variable by [@&#8203;HenkPoley](https://github.com/HenkPoley) in [#&#8203;12040](https://github.com/vimeo/psalm/pull/12040) - Fix missing `new $c` checks when the class string has a leading backslash by [@&#8203;HenkPoley](https://github.com/HenkPoley) in [#&#8203;12039](https://github.com/vimeo/psalm/pull/12039) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.19.0...6.19.1> ### [`v6.19.0`](https://github.com/vimeo/psalm/releases/tag/6.19.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.18.1...6.19.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - \[6.x] Support `@param-closure-this` docblock tag by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11853](https://github.com/vimeo/psalm/pull/11853) - \[6.x] Allow `#[\Override]` on properties (PHP 8.5) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11891](https://github.com/vimeo/psalm/pull/11891) - \[6.x] Support PHP 8.5 clone-with-properties by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11893](https://github.com/vimeo/psalm/pull/11893) - \[6.x] Accept string pseudo-type intersections in docblocks by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11823](https://github.com/vimeo/psalm/pull/11823) - \[6.x] extract `IdeDetector`, auto-detect IDE when none specified by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11802](https://github.com/vimeo/psalm/pull/11802) - \[6.x] Accept --no-progress in psalm-refactor by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11995](https://github.com/vimeo/psalm/pull/11995) - Add support for PHP 8.4 asymmetric property visibility by [@&#8203;danog](https://github.com/danog) in [#&#8203;11988](https://github.com/vimeo/psalm/pull/11988) - Enforce #\[\NoDiscard] on every analysed PHP version by [@&#8203;danog](https://github.com/danog) in [#&#8203;12007](https://github.com/vimeo/psalm/pull/12007) - Report native symbols used below the PHP version that introduced them by [@&#8203;danog](https://github.com/danog) in [#&#8203;12006](https://github.com/vimeo/psalm/pull/12006) - Load genuinely-new native classes on every PHP version, tagged with [@&#8203;since](https://github.com/since) by [@&#8203;danog](https://github.com/danog) in [#&#8203;12008](https://github.com/vimeo/psalm/pull/12008) - Respect PHP version guards when reporting unavailable native symbols by [@&#8203;danog](https://github.com/danog) in [#&#8203;12010](https://github.com/vimeo/psalm/pull/12010) - Date native functions and methods by the versioned callmaps by [@&#8203;danog](https://github.com/danog) in [#&#8203;12009](https://github.com/vimeo/psalm/pull/12009) ##### Fixes - \[6.x] Resolve transitive [@&#8203;mixin](https://github.com/mixin) chains (depth >= 2) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11868](https://github.com/vimeo/psalm/pull/11868) - \[6.x] Keep the template argument of a constructed generic object at a call site by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11991](https://github.com/vimeo/psalm/pull/11991) - \[6.x] Fix parallel scan crash on PHP-native intersection types by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11841](https://github.com/vimeo/psalm/pull/11841) - fix: shallow-scan `extraFiles` also for language server by [@&#8203;susnux](https://github.com/susnux) in [#&#8203;11919](https://github.com/vimeo/psalm/pull/11919) - \[6.x] Check set visibility for `clone()` withProperties keys by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11999](https://github.com/vimeo/psalm/pull/11999) - \[6.x] Resolve self/static template args against implementing class before bound check by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11833](https://github.com/vimeo/psalm/pull/11833) - Fix ClassMustBeFinal final insertion for [#&#8203;11460](https://github.com/vimeo/psalm/issues/11460) by [@&#8203;HenkPoley](https://github.com/HenkPoley) in [#&#8203;11855](https://github.com/vimeo/psalm/pull/11855) - Fix builtin class string instantiation by [@&#8203;HenkPoley](https://github.com/HenkPoley) in [#&#8203;11860](https://github.com/vimeo/psalm/pull/11860) - Fix invalid SARIF region for issues reported at line 0 by [@&#8203;eyupcanakman](https://github.com/eyupcanakman) in [#&#8203;11903](https://github.com/vimeo/psalm/pull/11903) - \[6.x] Resolve method templates for polymorphic array callables by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11815](https://github.com/vimeo/psalm/pull/11815) ##### Other changes - \[6.x] Add `TKeyedArray::make()` factory to 6.x for cross-version plugin compatibility by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11810](https://github.com/vimeo/psalm/pull/11810) - \[6.x] Quiet CLI output when running under an AI agent by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11812](https://github.com/vimeo/psalm/pull/11812) - Bump mheap/github-action-required-labels from 5.5.2 to 5.6.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11907](https://github.com/vimeo/psalm/pull/11907) - Bump actions/cache from 5.0.5 to 6.1.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11896](https://github.com/vimeo/psalm/pull/11896) - Bump docker/setup-buildx-action from 4.1.0 to 4.2.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11902](https://github.com/vimeo/psalm/pull/11902) - Bump docker/setup-buildx-action from 4.2.0 to 4.4.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;12005](https://github.com/vimeo/psalm/pull/12005) - Bump fkirc/skip-duplicate-actions from 5.3.1 to 5.3.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;12004](https://github.com/vimeo/psalm/pull/12004) - Bump actions/checkout from 6.0.2 to 7.0.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;12003](https://github.com/vimeo/psalm/pull/12003) - \[6.x] Propagate throws from pseudo-method dispatch by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11843](https://github.com/vimeo/psalm/pull/11843) - Fix for coding standard issue in commit [`ca15124`](https://github.com/vimeo/psalm/commit/ca15124) by [@&#8203;HenkPoley](https://github.com/HenkPoley) in [#&#8203;11856](https://github.com/vimeo/psalm/pull/11856) - Bump actions/cache from 5.0.5 to 6.1.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;12002](https://github.com/vimeo/psalm/pull/12002) #### New Contributors - [@&#8203;susnux](https://github.com/susnux) made their first contribution in [#&#8203;11919](https://github.com/vimeo/psalm/pull/11919) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.18.1...6.19.0> ### [`v6.18.1`](https://github.com/vimeo/psalm/releases/tag/6.18.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.18.0...6.18.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Emit issues on php <8.5 if overridden method uses self instead of static by [@&#8203;danog](https://github.com/danog) in [#&#8203;11985](https://github.com/vimeo/psalm/pull/11985) - \[6.x] Support parameter-conditional types in `@self-out` / `@this-out` by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11964](https://github.com/vimeo/psalm/pull/11964) ##### Fixes - fix: false-positive NullableReturnStatement when a nullsafe property fetch is compared to a non-nullable value by [@&#8203;yuriy-sorokin](https://github.com/yuriy-sorokin) in [#&#8203;11982](https://github.com/vimeo/psalm/pull/11982) ##### Other changes - \[6.x] Throw `TypeParseTreeException` for an incomplete conditional type by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11962](https://github.com/vimeo/psalm/pull/11962) #### New Contributors - [@&#8203;yuriy-sorokin](https://github.com/yuriy-sorokin) made their first contribution in [#&#8203;11982](https://github.com/vimeo/psalm/pull/11982) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.18.0...6.18.1> ### [`v6.18.0`](https://github.com/vimeo/psalm/releases/tag/6.18.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.17.2...6.18.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - \[6.x] Support the PHP 8.5 `#[\NoDiscard]` attribute by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11892](https://github.com/vimeo/psalm/pull/11892) ##### Fixes - Fix closure param type inference by [@&#8203;danog](https://github.com/danog) in [#&#8203;11972](https://github.com/vimeo/psalm/pull/11972) - Don't mint a type variable for a purely-mixed construction inference by [@&#8203;danog](https://github.com/danog) in [#&#8203;11973](https://github.com/vimeo/psalm/pull/11973) - Add the PHP 8.5 `trace` key to `error_get_last()` by [@&#8203;janedbal](https://github.com/janedbal) in [#&#8203;11975](https://github.com/vimeo/psalm/pull/11975) ##### Internal changes - Check out branch-specific baselines for test-with-real-projects by [@&#8203;danog](https://github.com/danog) in [#&#8203;11957](https://github.com/vimeo/psalm/pull/11957) ##### Other changes - \[6.x] Substitute `self` in `@property` type tokens at scan time by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11846](https://github.com/vimeo/psalm/pull/11846) #### New Contributors - [@&#8203;janedbal](https://github.com/janedbal) made their first contribution in [#&#8203;11975](https://github.com/vimeo/psalm/pull/11975) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.17.2...6.18.0> ### [`v6.17.2`](https://github.com/vimeo/psalm/releases/tag/6.17.2) [Compare Source](https://github.com/vimeo/psalm/compare/6.17.1...6.17.2) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix function manipulator by [@&#8203;danog](https://github.com/danog) in [#&#8203;11671](https://github.com/vimeo/psalm/pull/11671) - Update nikic/php-parser version to ^5.2.0 by [@&#8203;danielmorell](https://github.com/danielmorell) in [#&#8203;11927](https://github.com/vimeo/psalm/pull/11927) ##### Other changes - Fix crash on first-class callables in taint analysis by [@&#8203;Portll](https://github.com/Portll) in [#&#8203;11932](https://github.com/vimeo/psalm/pull/11932) - Fix MissingOverrideAttribute false positive for private trait methods by [@&#8203;Eljees](https://github.com/Eljees) in [#&#8203;11926](https://github.com/vimeo/psalm/pull/11926) #### New Contributors - [@&#8203;Portll](https://github.com/Portll) made their first contribution in [#&#8203;11932](https://github.com/vimeo/psalm/pull/11932) - [@&#8203;danielmorell](https://github.com/danielmorell) made their first contribution in [#&#8203;11927](https://github.com/vimeo/psalm/pull/11927) - [@&#8203;Eljees](https://github.com/Eljees) made their first contribution in [#&#8203;11926](https://github.com/vimeo/psalm/pull/11926) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.17.1...6.17.2> ### [`v6.17.1`](https://github.com/vimeo/psalm/releases/tag/6.17.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.17.0...6.17.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix [#&#8203;11937](https://github.com/vimeo/psalm/issues/11937) by [@&#8203;danog](https://github.com/danog) in [#&#8203;11938](https://github.com/vimeo/psalm/pull/11938) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.17.0...6.17.1> ### [`v6.17.0`](https://github.com/vimeo/psalm/releases/tag/6.17.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.16.1...6.17.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Support better template inference with type variables: class templates that cannot be inferred at the construction site are now tracked as type variables whose bounds are reconciled once the surrounding function has been analyzed. This legalizes widening within a template's declared bounds (e.g. `new Box(1)` followed by `$box->set('two')` under `@template T of int|string`) and introduces the new `IncompatibleTypeParameters` issue (level 1), documented in <https://psalm.dev/docs/annotating_code/type_variables/> by [@&#8203;muglug](https://github.com/muglug) in [#&#8203;11875](https://github.com/vimeo/psalm/pull/11875) ##### Fixes - \[6.x] Fix InterfaceAnalyzer crash when storage is overwritten by reflection by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11760](https://github.com/vimeo/psalm/pull/11760) - \[6.x] Fix `$this` failing to parse inside generic type parameters by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11768](https://github.com/vimeo/psalm/pull/11768) - \[6.x] Use macOS bundle ID for PhpStorm (support JetBrains Tool installed apps), respect `PHPSTORM` env var on Darwin by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11801](https://github.com/vimeo/psalm/pull/11801) - \[6.x] Ignore inline `covariant`/`contravariant` keywords in generic type parameters instead of reporting `UndefinedDocblockClass` (backport) by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11836](https://github.com/vimeo/psalm/pull/11836) - Keep foreach key/value non-nullable after a breaking loop by [@&#8203;muglug](https://github.com/muglug) in [#&#8203;11874](https://github.com/vimeo/psalm/pull/11874) - PHP 8.5 compatibility: `TLiteralFloat` now renders `NAN` values as `float(NAN)` in type keys and IDs instead of crashing by [@&#8203;danog](https://github.com/danog) in [`9d6db9e`](https://github.com/vimeo/psalm/commit/9d6db9ec7fdd21072593a137405fcee3c96bdac3) and [`ca15124`](https://github.com/vimeo/psalm/commit/ca151242c84d8962b921bf59c509b49362ce0eec) ##### Docs - Add `docs/annotating_code/type_variables.md` and the `IncompatibleTypeParameters` issue page by [@&#8203;muglug](https://github.com/muglug) in [#&#8203;11875](https://github.com/vimeo/psalm/pull/11875) ##### Internal changes - \[6.x] fix tests: drop incorrect `impure-` Closure prefix in TypeParseTest by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11834](https://github.com/vimeo/psalm/pull/11834) - \[6.x] fix tests: whitelist `Override` in SuicidalAutoloader fixture by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11835](https://github.com/vimeo/psalm/pull/11835) - fix: pin GitHub Actions to SHA for supply chain security by [@&#8203;riccardosarro](https://github.com/riccardosarro) in [#&#8203;11863](https://github.com/vimeo/psalm/pull/11863) - Clean up redundant assignment-conditions and repeated getArgs() calls by [@&#8203;muglug](https://github.com/muglug) in [#&#8203;11888](https://github.com/vimeo/psalm/pull/11888) - Remove dead write-only static properties and simplify ScopeAnalyzer break/continue logic by [@&#8203;muglug](https://github.com/muglug) in [#&#8203;11889](https://github.com/vimeo/psalm/pull/11889) - Fix `test-with-real-projects.sh` on macOS (use `gsed` when available, tolerate a missing phar) by [@&#8203;danog](https://github.com/danog) in [`9d6db9e`](https://github.com/vimeo/psalm/commit/9d6db9ec7fdd21072593a137405fcee3c96bdac3) - Fix macOS CI: bump setup-php to v2.37.2 so PHP 8.5 installs on macos-15 by [@&#8203;danog](https://github.com/danog) in [`a2892df`](https://github.com/vimeo/psalm/commit/a2892dfd1) - Fix Mockery 1.6.15 compatibility in plugin tests by [@&#8203;danog](https://github.com/danog) in [`7b50a17`](https://github.com/vimeo/psalm/commit/7b50a1725) - Drop `voidParamType` test: nikic/php-parser 5.8 rejects void params at parse time by [@&#8203;danog](https://github.com/danog) in [`056992a`](https://github.com/vimeo/psalm/commit/056992a90) ##### Other changes - Allow sebastian/diff 9 by [@&#8203;liviuconcioiu](https://github.com/liviuconcioiu) in [#&#8203;11861](https://github.com/vimeo/psalm/pull/11861) #### New Contributors - [@&#8203;riccardosarro](https://github.com/riccardosarro) made their first contribution in [#&#8203;11863](https://github.com/vimeo/psalm/pull/11863) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.16.1...6.17.0> ### [`v6.16.1`](https://github.com/vimeo/psalm/releases/tag/6.16.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.16.0...6.16.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix --show-snippet option silently consuming next CLI argument by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11684](https://github.com/vimeo/psalm/pull/11684) - Explicitly disable JIT by default by [@&#8203;danog](https://github.com/danog) in [#&#8203;11745](https://github.com/vimeo/psalm/pull/11745) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.16.0...6.16.1> ### [`v6.16.0`](https://github.com/vimeo/psalm/releases/tag/6.16.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.15.1...6.16.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Add stub for memcached by [@&#8203;ADmad](https://github.com/ADmad) in [#&#8203;11717](https://github.com/vimeo/psalm/pull/11717) ##### Fixes - Fix duplicate error for abstract methods in traits if the issue is due to the implementer by [@&#8203;kkmuffme](https://github.com/kkmuffme) in [#&#8203;11695](https://github.com/vimeo/psalm/pull/11695) - Report regular issue instead of throw/crash by [@&#8203;kkmuffme](https://github.com/kkmuffme) in [#&#8203;11693](https://github.com/vimeo/psalm/pull/11693) - Add PHP 8.5 (and 8.4) handling where it wasn't added yet by [@&#8203;kkmuffme](https://github.com/kkmuffme) in [#&#8203;11697](https://github.com/vimeo/psalm/pull/11697) - curl_share_init_persistent requires non-empty array otherwise throws by [@&#8203;kkmuffme](https://github.com/kkmuffme) in [#&#8203;11701](https://github.com/vimeo/psalm/pull/11701) - Add max_depth option to unserialize() callmap type by [@&#8203;eyupcanakman](https://github.com/eyupcanakman) in [#&#8203;11702](https://github.com/vimeo/psalm/pull/11702) - Fix false InvalidArgument for sprintf precision placeholders by [@&#8203;eyupcanakman](https://github.com/eyupcanakman) in [#&#8203;11729](https://github.com/vimeo/psalm/pull/11729) ##### Internal changes - Disable JIT by default, make it opt-in via --force-jit by [@&#8203;alies-dev](https://github.com/alies-dev) in [#&#8203;11682](https://github.com/vimeo/psalm/pull/11682) - Regenerate callmaps to include new ext-mongodb 2.2 API by [@&#8203;alcaeus](https://github.com/alcaeus) in [#&#8203;11720](https://github.com/vimeo/psalm/pull/11720) - Bump docker/setup-buildx-action from 3 to 4 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11719](https://github.com/vimeo/psalm/pull/11719) #### New Contributors - [@&#8203;eyupcanakman](https://github.com/eyupcanakman) made their first contribution in [#&#8203;11702](https://github.com/vimeo/psalm/pull/11702) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.15.1...6.16.0> ### [`v6.15.1`](https://github.com/vimeo/psalm/releases/tag/6.15.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.15.0...6.15.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Internal changes - Allow sebastian/diff 8 by [@&#8203;Jean85](https://github.com/Jean85) in [#&#8203;11667](https://github.com/vimeo/psalm/pull/11667) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.15.0...6.15.1> ### [`v6.15.0`](https://github.com/vimeo/psalm/releases/tag/6.15.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.14.3...6.15.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> Note: GPG signatures for older releases will be regenerated shortly using the new `99BF4D9A33D65E1E` key, since the old one expired. #### What's Changed ##### Features - Support PHP 8.4 interface property hooks by [@&#8203;adamaveray](https://github.com/adamaveray) in [#&#8203;11569](https://github.com/vimeo/psalm/pull/11569) ##### Fixes - Improve performance of getIssueTrace by [@&#8203;danog](https://github.com/danog) in [#&#8203;11629](https://github.com/vimeo/psalm/pull/11629) - Minor property hook improvements by [@&#8203;danog](https://github.com/danog) in [#&#8203;11657](https://github.com/vimeo/psalm/pull/11657) - Fix GPG signing key by [@&#8203;danog](https://github.com/danog) in [#&#8203;11658](https://github.com/vimeo/psalm/pull/11658) ##### Other changes - Add a missing argument of PDO::sqliteCreateFunction(). by [@&#8203;sukei](https://github.com/sukei) in [#&#8203;11591](https://github.com/vimeo/psalm/pull/11591) #### New Contributors - [@&#8203;adamaveray](https://github.com/adamaveray) made their first contribution in [#&#8203;11569](https://github.com/vimeo/psalm/pull/11569) - [@&#8203;sukei](https://github.com/sukei) made their first contribution in [#&#8203;11591](https://github.com/vimeo/psalm/pull/11591) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.14.3...6.15.0> ### [`v6.14.3`](https://github.com/vimeo/psalm/releases/tag/6.14.3) [Compare Source](https://github.com/vimeo/psalm/compare/6.14.2...6.14.3) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Remove redefinition of Attribute constants. by [@&#8203;hschletz](https://github.com/hschletz) in [#&#8203;11625](https://github.com/vimeo/psalm/pull/11625) - Remove usages of deprecated `curl_close()` function by [@&#8203;theodorejb](https://github.com/theodorejb) in [#&#8203;11626](https://github.com/vimeo/psalm/pull/11626) - Declare `NoDiscard` attribute as immutable by [@&#8203;Baptouuuu](https://github.com/Baptouuuu) in [#&#8203;11611](https://github.com/vimeo/psalm/pull/11611) - dependencies : allow symfony 8 by [@&#8203;NicolasDievart](https://github.com/NicolasDievart) in [#&#8203;11594](https://github.com/vimeo/psalm/pull/11594) ##### Internal changes - Bump actions/cache from 4 to 5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11623](https://github.com/vimeo/psalm/pull/11623) ##### Other changes #### New Contributors - [@&#8203;hschletz](https://github.com/hschletz) made their first contribution in [#&#8203;11625](https://github.com/vimeo/psalm/pull/11625) - [@&#8203;Baptouuuu](https://github.com/Baptouuuu) made their first contribution in [#&#8203;11611](https://github.com/vimeo/psalm/pull/11611) - [@&#8203;NicolasDievart](https://github.com/NicolasDievart) made their first contribution in [#&#8203;11594](https://github.com/vimeo/psalm/pull/11594) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.14.2...6.14.3> ### [`v6.14.2`](https://github.com/vimeo/psalm/releases/tag/6.14.2) [Compare Source](https://github.com/vimeo/psalm/compare/6.14.1...6.14.2) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix supported versions regex by [@&#8203;danog](https://github.com/danog) in [#&#8203;11614](https://github.com/vimeo/psalm/pull/11614) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.14.1...6.14.2> ### [`v6.14.1`](https://github.com/vimeo/psalm/releases/tag/6.14.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.14.0...6.14.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Do not ignore null array offsets within isset by [@&#8203;danog](https://github.com/danog) in [#&#8203;11608](https://github.com/vimeo/psalm/pull/11608) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.14.0...6.14.1> ### [`v6.14.0`](https://github.com/vimeo/psalm/releases/tag/6.14.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.13.1...6.14.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Add PHP 8.5 support by [@&#8203;MarjovanLier](https://github.com/MarjovanLier) in [#&#8203;11604](https://github.com/vimeo/psalm/pull/11604) - Add PHP 8.5 support by [@&#8203;danog](https://github.com/danog) ##### Internal changes - Improve performance by avoiding repeated scanning of files included/required only once by [@&#8203;mmcev106](https://github.com/mmcev106) in [#&#8203;11478](https://github.com/vimeo/psalm/pull/11478) ##### Other changes - feat(language server): add --on-open-debounce-ms by [@&#8203;kk-daniel](https://github.com/kk-daniel) in [#&#8203;11550](https://github.com/vimeo/psalm/pull/11550) - fix(language server): fix --on-change-debounce-ms by [@&#8203;kk-daniel](https://github.com/kk-daniel) in [#&#8203;11549](https://github.com/vimeo/psalm/pull/11549) - Replace deprecated \_\_sleep method with \_\_serialize by [@&#8203;theodorejb](https://github.com/theodorejb) in [#&#8203;11563](https://github.com/vimeo/psalm/pull/11563) - Fix the opcache status retrieval if restricted paths are set. by [@&#8203;dmvrtx](https://github.com/dmvrtx) in [#&#8203;11556](https://github.com/vimeo/psalm/pull/11556) - Bump actions/checkout from 4 to 5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11539](https://github.com/vimeo/psalm/pull/11539) - fix: deprecations for PHP 8.5 by [@&#8203;jorgsowa](https://github.com/jorgsowa) in [#&#8203;11541](https://github.com/vimeo/psalm/pull/11541) - ci: add nikic/php-parser deprecations to Psalm baseline by [@&#8203;jorgsowa](https://github.com/jorgsowa) in [#&#8203;11596](https://github.com/vimeo/psalm/pull/11596) - fix: deprecated null offset by [@&#8203;jorgsowa](https://github.com/jorgsowa) in [#&#8203;11599](https://github.com/vimeo/psalm/pull/11599) - Bump actions/checkout from 5 to 6 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11593](https://github.com/vimeo/psalm/pull/11593) #### New Contributors - [@&#8203;dmvrtx](https://github.com/dmvrtx) made their first contribution in [#&#8203;11556](https://github.com/vimeo/psalm/pull/11556) - [@&#8203;MarjovanLier](https://github.com/MarjovanLier) made their first contribution in [#&#8203;11604](https://github.com/vimeo/psalm/pull/11604) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.13.1...6.14.0> ### [`v6.13.1`](https://github.com/vimeo/psalm/releases/tag/6.13.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.13.0...6.13.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Add windows support to psalm-review by [@&#8203;HenkPoley](https://github.com/HenkPoley) in [#&#8203;11528](https://github.com/vimeo/psalm/pull/11528) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.13.0...6.13.1> ### [`v6.13.0`](https://github.com/vimeo/psalm/releases/tag/6.13.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.12.1...6.13.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - :sparkles: Full support for iterables for `iterator_to_array` by [@&#8203;andrew-demb](https://github.com/andrew-demb) in [#&#8203;11430](https://github.com/vimeo/psalm/pull/11430) - Add an `arrayCache` configuration key that can be used to disable the newly introduced array cache: this will slightly slow down execution times while reducing RAM usage, avoiding OOM issues on bigger codebases by [@&#8203;danog](https://github.com/danog) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.12.1...6.13.0> ### [`v6.12.1`](https://github.com/vimeo/psalm/releases/tag/6.12.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.12.0...6.12.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix false negatives with mixed in templated value-of/key-of by [@&#8203;danog](https://github.com/danog) in [#&#8203;11499](https://github.com/vimeo/psalm/pull/11499) - [Avoid tainting problems with first-class callables](https://github.com/vimeo/psalm/commit/a9d82d46f6c21cf3e31cbe197157343654420694) by [@&#8203;danog](https://github.com/danog) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.12.0...6.12.1> ### [`v6.12.0`](https://github.com/vimeo/psalm/releases/tag/6.12.0): - Cache refactoring [Compare Source](https://github.com/vimeo/psalm/compare/6.11.0...6.12.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> This release features a major cache refactoring, improving stability, removing race conditions and adding a new feature called cache consolidation, which consolidates the cache, normally composed of split files, into one single file with the `--consolidate-cache` flag, for quicker runs when doing whole project scans! To use cache consolidation, simply run Psalm with the `--consolidate-cache` flag after running a normal analysis: running with this flag will skip analysis and only consolidate the cache. If you consolidate your cache in CI runs, sure to re-consolidate the cache again after running Psalm before re-saving the updated cache. #### What's Changed ##### Features - Implement cache consolidation with --consolidate-cache flag by [@&#8203;danog](https://github.com/danog) in [#&#8203;11450](https://github.com/vimeo/psalm/pull/11450) - Cache refactoring by [@&#8203;danog](https://github.com/danog) in [#&#8203;11415](https://github.com/vimeo/psalm/pull/11415) - Add ignoreIncludeSideEffects configuration key by [@&#8203;danog](https://github.com/danog) in [#&#8203;11451](https://github.com/vimeo/psalm/pull/11451) ##### Fixes - Fix crash on numeric annotation by [@&#8203;VincentLanglet](https://github.com/VincentLanglet) in [#&#8203;11445](https://github.com/vimeo/psalm/pull/11445) - Disable diffing if not in diff run by [@&#8203;danog](https://github.com/danog) in [#&#8203;11447](https://github.com/vimeo/psalm/pull/11447) - Update stubs for ext-mongodb 2.0 by [@&#8203;alcaeus](https://github.com/alcaeus) in [#&#8203;11453](https://github.com/vimeo/psalm/pull/11453) - Update stubs for ext-mongodb 2.1 by [@&#8203;alcaeus](https://github.com/alcaeus) in [#&#8203;11454](https://github.com/vimeo/psalm/pull/11454) ##### Docs - \[Doc] Clarify union vs. intersection for `numeric` supertype by [@&#8203;kylekatarnls](https://github.com/kylekatarnls) in [#&#8203;11444](https://github.com/vimeo/psalm/pull/11444) #### New Contributors - [@&#8203;kylekatarnls](https://github.com/kylekatarnls) made their first contribution in [#&#8203;11444](https://github.com/vimeo/psalm/pull/11444) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.11.0...6.12.0> ### [`v6.11.0`](https://github.com/vimeo/psalm/releases/tag/6.11.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.10.3...6.11.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Add new `ClassFilePathProviderInterface` plugin hook to polyfill custom autoloaders by [@&#8203;danog](https://github.com/danog) in [#&#8203;11422](https://github.com/vimeo/psalm/pull/11422) ##### Fixes - Small analysis bugfix by [@&#8203;danog](https://github.com/danog) Subscribe to the brand new [Psalm newsletter to stay up to date with all of Psalm's news](https://blog.daniil.it/newsletter/)! **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.10.3...6.11.0> ### [`v6.10.3`](https://github.com/vimeo/psalm/releases/tag/6.10.3) [Compare Source](https://github.com/vimeo/psalm/compare/6.10.2...6.10.3) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix [#&#8203;11420](https://github.com/vimeo/psalm/issues/11420) by [@&#8203;danog](https://github.com/danog) in [#&#8203;11421](https://github.com/vimeo/psalm/pull/11421) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.10.2...6.10.3> ### [`v6.10.2`](https://github.com/vimeo/psalm/releases/tag/6.10.2) [Compare Source](https://github.com/vimeo/psalm/compare/6.10.1...6.10.2) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - InvalidNamedArgument "objectOrClass" for ReflectionClass constructor due to incorrect stub by [@&#8203;savinmikhail](https://github.com/savinmikhail) in [#&#8203;11407](https://github.com/vimeo/psalm/pull/11407) - DateTimeImmutable::setTimestamp rename argument to $timestamp by [@&#8203;savinmikhail](https://github.com/savinmikhail) in [#&#8203;11409](https://github.com/vimeo/psalm/pull/11409) - fix: alter of ClassMustBeFinal inserts final before attributes by [@&#8203;Tofandel](https://github.com/Tofandel) in [#&#8203;11390](https://github.com/vimeo/psalm/pull/11390) - Add fix for PropertyHooks by [@&#8203;craig-mcmahon](https://github.com/craig-mcmahon) in [#&#8203;11411](https://github.com/vimeo/psalm/pull/11411) - Disable diff mode by [@&#8203;danog](https://github.com/danog) in [#&#8203;11416](https://github.com/vimeo/psalm/pull/11416) #### New Contributors - [@&#8203;savinmikhail](https://github.com/savinmikhail) made their first contribution in [#&#8203;11407](https://github.com/vimeo/psalm/pull/11407) - [@&#8203;craig-mcmahon](https://github.com/craig-mcmahon) made their first contribution in [#&#8203;11411](https://github.com/vimeo/psalm/pull/11411) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.10.1...6.10.2> ### [`v6.10.1`](https://github.com/vimeo/psalm/releases/tag/6.10.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.10.0...6.10.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Deprecate reflection's setAccessible on 8.1+ by [@&#8203;danog](https://github.com/danog) in [#&#8203;11401](https://github.com/vimeo/psalm/pull/11401) - Better types for mb_substitute_character by [@&#8203;danog](https://github.com/danog) in [#&#8203;11400](https://github.com/vimeo/psalm/pull/11400) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.10.0...6.10.1> ### [`v6.10.0`](https://github.com/vimeo/psalm/releases/tag/6.10.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.9.6...6.10.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> [Join the new official Psalm news channel](https://t.me/psalmphp) and the [Psalm community](https://t.me/psalmphp_community)! The news channel will be used to share inside exclusive news about upcoming Psalm features (including property hook support, coming within the next few releases!), and the community group can be used to discuss and share the way you use Psalm! #### What's Changed ##### Features - Add rank to SARIF report by [@&#8203;danog](https://github.com/danog) in [#&#8203;11383](https://github.com/vimeo/psalm/pull/11383) - Add forceJit and noCache configuration keys by [@&#8203;danog](https://github.com/danog) in [#&#8203;11380](https://github.com/vimeo/psalm/pull/11380) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.9.6...6.10.0> ### [`v6.9.6`](https://github.com/vimeo/psalm/releases/tag/6.9.6) [Compare Source](https://github.com/vimeo/psalm/compare/6.9.5...6.9.6) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> Add git, ssh and composer to the docker image by [@&#8203;danog](https://github.com/danog). **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.9.5...6.9.6> ### [`v6.9.5`](https://github.com/vimeo/psalm/releases/tag/6.9.5) [Compare Source](https://github.com/vimeo/psalm/compare/6.9.4...6.9.5) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix some possible JIT crashes in official docker image by [@&#8203;danog](https://github.com/danog) - Improve stub generation by [@&#8203;danog](https://github.com/danog) - Merge multiple docblocks for statements by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;11371](https://github.com/vimeo/psalm/pull/11371) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.9.4...6.9.5> ### [`v6.9.4`](https://github.com/vimeo/psalm/releases/tag/6.9.4) [Compare Source](https://github.com/vimeo/psalm/compare/6.9.3...6.9.4) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Backport [#&#8203;11364](https://github.com/vimeo/psalm/issues/11364) to 6.x by [@&#8203;haas-dtv](https://github.com/haas-dtv) in [#&#8203;11369](https://github.com/vimeo/psalm/pull/11369) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.9.3...6.9.4> ### [`v6.9.3`](https://github.com/vimeo/psalm/releases/tag/6.9.3) [Compare Source](https://github.com/vimeo/psalm/compare/6.9.2...6.9.3) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Hotfix [#&#8203;11363](https://github.com/vimeo/psalm/issues/11363) by [@&#8203;danog](https://github.com/danog) in [#&#8203;11366](https://github.com/vimeo/psalm/pull/11366) ##### Internal changes - Bump docker image to PHP 8.4.5 by [@&#8203;danog](https://github.com/danog) in [#&#8203;11367](https://github.com/vimeo/psalm/pull/11367) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.9.2...6.9.3> ### [`v6.9.2`](https://github.com/vimeo/psalm/releases/tag/6.9.2) [Compare Source](https://github.com/vimeo/psalm/compare/6.9.1...6.9.2) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> Fixes multiplatform builds for the `latest` tag of the [docker image »](https://psalm.dev/docs/running_psalm/installation/#docker-image). **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.9.1...6.9.2> ### [`v6.9.1`](https://github.com/vimeo/psalm/compare/6.9.0...6.9.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.9.0...6.9.1) ### [`v6.9.0`](https://github.com/vimeo/psalm/releases/tag/6.9.0): - Docker image! [Compare Source](https://github.com/vimeo/psalm/compare/6.8.9...6.9.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> Psalm now has an official docker image! It uses a custom build of PHP built from scratch, running Psalm **+30% faster** on average than normal PHP (**+50% faster** if comparing to PHP without opcache installed). To use it, simply run: ```bash docker run -v $PWD:/app --rm -it ghcr.io/danog/psalm:latest /composer/vendor/bin/psalm --no-cache ``` Issues due to missing extensions can be fixed by enabling them in psalm.xml and/or requiring them in composer.json, [see here »](https://psalm.dev/docs/running_psalm/configuration/#enableextensions) for more info. Extensions not stubbed by Psalm itself (and thus not available as a psalm config option) may be stubbed using [traditional PHP stubs](https://github.com/JetBrains/phpstorm-stubs/). #### What's Changed ##### Features - Add docker image by [@&#8203;danog](https://github.com/danog) in [#&#8203;11307](https://github.com/vimeo/psalm/pull/11307) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.9...6.9.0> ### [`v6.8.9`](https://github.com/vimeo/psalm/releases/tag/6.8.9) [Compare Source](https://github.com/vimeo/psalm/compare/6.8.8...6.8.9) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix polyfill version range by [@&#8203;danog](https://github.com/danog) in [#&#8203;11345](https://github.com/vimeo/psalm/pull/11345) - Improve idn_to\_\* signatures for 8.4 by [@&#8203;danog](https://github.com/danog) in [#&#8203;11351](https://github.com/vimeo/psalm/pull/11351) - push original callable when creating callable-object in order to keep return type by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;11354](https://github.com/vimeo/psalm/pull/11354) ##### Internal changes - Small performance improvement by [@&#8203;danog](https://github.com/danog) in [#&#8203;11348](https://github.com/vimeo/psalm/pull/11348) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.8...6.8.9> ### [`v6.8.8`](https://github.com/vimeo/psalm/releases/tag/6.8.8) [Compare Source](https://github.com/vimeo/psalm/compare/6.8.7...6.8.8) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix Could not locate trait statement errors by [@&#8203;danog](https://github.com/danog) in [#&#8203;11341](https://github.com/vimeo/psalm/pull/11341) ##### Internal changes - Improve debugging of PHP bugs by [@&#8203;danog](https://github.com/danog) in [#&#8203;11339](https://github.com/vimeo/psalm/pull/11339) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.7...6.8.8> ### [`v6.8.7`](https://github.com/vimeo/psalm/releases/tag/6.8.7) [Compare Source](https://github.com/vimeo/psalm/compare/6.8.6...6.8.7) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix array_reverse type for `list{0: int, 1?: int}` etc. by [@&#8203;MoonE](https://github.com/MoonE) in [#&#8203;11150](https://github.com/vimeo/psalm/pull/11150) - Improve closure template inference by [@&#8203;danog](https://github.com/danog) in [#&#8203;11334](https://github.com/vimeo/psalm/pull/11334) - Allow RoundingMode as param to round by [@&#8203;danog](https://github.com/danog) in [#&#8203;11335](https://github.com/vimeo/psalm/pull/11335) - Fix issues with array_any by [@&#8203;danog](https://github.com/danog) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.6...6.8.7> ### [`v6.8.6`](https://github.com/vimeo/psalm/releases/tag/6.8.6) [Compare Source](https://github.com/vimeo/psalm/compare/6.8.5...6.8.6) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Allow integer and string concatenation by [@&#8203;danog](https://github.com/danog) in [#&#8203;11329](https://github.com/vimeo/psalm/pull/11329) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.5...6.8.6> ### [`v6.8.5`](https://github.com/vimeo/psalm/releases/tag/6.8.5) [Compare Source](https://github.com/vimeo/psalm/compare/6.8.4...6.8.5) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fixes PHP Error: Undefined array key 1 by [@&#8203;tm1000](https://github.com/tm1000) in [#&#8203;11328](https://github.com/vimeo/psalm/pull/11328) - Fix issue with plugins by `@danog` **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.4...6.8.5> ### [`v6.8.4`](https://github.com/vimeo/psalm/releases/tag/6.8.4) [Compare Source](https://github.com/vimeo/psalm/compare/6.8.3...6.8.4) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> This release introduces fully reproducible builds (the composer.lock file is now added to phars). **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.3...6.8.4> ### [`v6.8.3`](https://github.com/vimeo/psalm/releases/tag/6.8.3) [Compare Source](https://github.com/vimeo/psalm/compare/6.8.2...6.8.3) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix phar build by bumping box (the minimum supported PHP version for the phar is now PHP 8.2) by [@&#8203;danog](https://github.com/danog) in [#&#8203;11324](https://github.com/vimeo/psalm/pull/11324) ##### Internal changes - Reproducible builds (fixes [#&#8203;10446](https://github.com/vimeo/psalm/issues/10446)) by [@&#8203;danog](https://github.com/danog) in [#&#8203;10566](https://github.com/vimeo/psalm/pull/10566) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.2...6.8.3> ### [`v6.8.2`](https://github.com/vimeo/psalm/releases/tag/6.8.2) [Compare Source](https://github.com/vimeo/psalm/compare/6.8.1...6.8.2) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Fix phar generation by [@&#8203;danog](https://github.com/danog) in [#&#8203;11323](https://github.com/vimeo/psalm/pull/11323) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.1...6.8.2> ### [`v6.8.1`](https://github.com/vimeo/psalm/releases/tag/6.8.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.8.0...6.8.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Internal changes - Log PHP version earlier by [@&#8203;danog](https://github.com/danog) in [#&#8203;11317](https://github.com/vimeo/psalm/pull/11317) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.8.0...6.8.1> ### [`v6.8.0`](https://github.com/vimeo/psalm/releases/tag/6.8.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.7.1...6.8.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Add longScanWarning config by [@&#8203;danog](https://github.com/danog) in [#&#8203;11302](https://github.com/vimeo/psalm/pull/11302) - Preload all classes before forking (+5% performance) by [@&#8203;danog](https://github.com/danog) in [#&#8203;11309](https://github.com/vimeo/psalm/pull/11309) - Improve new array function types, add Deprecated attr support by [@&#8203;danog](https://github.com/danog) in [#&#8203;11303](https://github.com/vimeo/psalm/pull/11303) ##### Fixes - Die when PHP doc not found in update-property-map.php by [@&#8203;M393](https://github.com/M393) in [#&#8203;11136](https://github.com/vimeo/psalm/pull/11136) - Do not throw exceptions on deprecation errors while autoloading deps by [@&#8203;danog](https://github.com/danog) in [#&#8203;11313](https://github.com/vimeo/psalm/pull/11313) - Fix ElseIfAnalyzer inconsistency and remove dead code by [@&#8203;theodorejb](https://github.com/theodorejb) in [#&#8203;10611](https://github.com/vimeo/psalm/pull/10611) - Deduplicate loop analysis by [@&#8203;theodorejb](https://github.com/theodorejb) in [#&#8203;10782](https://github.com/vimeo/psalm/pull/10782) - Add correct type to readline_completion_function by [@&#8203;danog](https://github.com/danog) in [#&#8203;11316](https://github.com/vimeo/psalm/pull/11316) - Add rdkafka to extension list in config.xsd by [@&#8203;danog](https://github.com/danog) in [#&#8203;11314](https://github.com/vimeo/psalm/pull/11314) #### New Contributors - [@&#8203;M393](https://github.com/M393) made their first contribution in [#&#8203;11136](https://github.com/vimeo/psalm/pull/11136) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.7.1...6.8.0> ### [`v6.7.1`](https://github.com/vimeo/psalm/releases/tag/6.7.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.7.0...6.7.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Internal changes - Require jsonmapper v5 by [@&#8203;danog](https://github.com/danog) in [#&#8203;11300](https://github.com/vimeo/psalm/pull/11300) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.7.0...6.7.1> ### [`v6.7.0`](https://github.com/vimeo/psalm/releases/tag/6.7.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.6.2...6.7.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Add new `allowBoolToLiteralBoolComparison` config (disabled by default), used to control emission of `RedundantIdentityWithTrue` issues (previously, their emission was controlled by the `strictBinaryOperands` config) by [@&#8203;danog](https://github.com/danog) in [#&#8203;11283](https://github.com/vimeo/psalm/pull/11283) - Enable missing `#[Override]` attribute detection (automatic Psalter fixer available) by [@&#8203;danog](https://github.com/danog) in [#&#8203;11283](https://github.com/vimeo/psalm/pull/11283) - Enable strict binary operand comparison checks (useful for strict_types migration) by [@&#8203;danog](https://github.com/danog) in [#&#8203;11283](https://github.com/vimeo/psalm/pull/11283) - Seal all class properties and methods: this enforces exact description of all class magic (\_\_get/\_\_call...) methods and properties with `@method` or `@property`, see [here](https://psalm.dev/docs/running_psalm/issues/UndefinedMagicPropertyFetch/) for more info by [@&#8203;danog](https://github.com/danog) in [#&#8203;11283](https://github.com/vimeo/psalm/pull/11283) - Disable dangerous `@psalm-suppress all` annotation (may be re-enabled manually with the disableSuppressAll config) by [@&#8203;danog](https://github.com/danog) in [#&#8203;11283](https://github.com/vimeo/psalm/pull/11283) - Types in lazy objects by [@&#8203;BenMorel](https://github.com/BenMorel) in [#&#8203;11296](https://github.com/vimeo/psalm/pull/11296) ##### Fixes - Fix parameter name in SplObjectStorage by [@&#8203;kamil-tekiela](https://github.com/kamil-tekiela) in [#&#8203;11134](https://github.com/vimeo/psalm/pull/11134) - Fix empty compact report if baseline file is used by [@&#8203;andrey-tech](https://github.com/andrey-tech) in [#&#8203;11111](https://github.com/vimeo/psalm/pull/11111) ##### Internal changes - Expose Progress instance to plugins by [@&#8203;danog](https://github.com/danog) in [#&#8203;11297](https://github.com/vimeo/psalm/pull/11297) - Change PluginEntryPointInterface to take a PluginRegistrationSocket [@&#8203;danog](https://github.com/danog) in [#&#8203;11298](https://github.com/vimeo/psalm/pull/11298) #### New Contributors - [@&#8203;andrey-tech](https://github.com/andrey-tech) made their first contribution in [#&#8203;11111](https://github.com/vimeo/psalm/pull/11111) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.6.2...6.7.0> ### [`v6.6.2`](https://github.com/vimeo/psalm/releases/tag/6.6.2) [Compare Source](https://github.com/vimeo/psalm/compare/6.6.1...6.6.2) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Allow running generate_testsuites.php from a different dir by [@&#8203;MoonE](https://github.com/MoonE) in [#&#8203;11155](https://github.com/vimeo/psalm/pull/11155) - Add missing reset of context inside_general_use by [@&#8203;MoonE](https://github.com/MoonE) in [#&#8203;11157](https://github.com/vimeo/psalm/pull/11157) - Fix false positives for UnusedIssueHandlerSuppression by [@&#8203;edsrzf](https://github.com/edsrzf) in [#&#8203;11212](https://github.com/vimeo/psalm/pull/11212) - Fix condition on literal-string by [@&#8203;VincentLanglet](https://github.com/VincentLanglet) in [#&#8203;11252](https://github.com/vimeo/psalm/pull/11252) - Object property types by [@&#8203;MoonE](https://github.com/MoonE) in [#&#8203;11291](https://github.com/vimeo/psalm/pull/11291) - Fix some more tests when running phpunit with args by [@&#8203;MoonE](https://github.com/MoonE) in [#&#8203;11153](https://github.com/vimeo/psalm/pull/11153) - Fix type of property-get with coalesce by [@&#8203;MoonE](https://github.com/MoonE) in [#&#8203;11152](https://github.com/vimeo/psalm/pull/11152) - Fix condition on lowercase-string by [@&#8203;VincentLanglet](https://github.com/VincentLanglet) in [#&#8203;11293](https://github.com/vimeo/psalm/pull/11293) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.6.1...6.6.2> ### [`v6.6.1`](https://github.com/vimeo/psalm/releases/tag/6.6.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.6.0...6.6.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - fix: add taint source on plugin-added taints by [@&#8203;Patrick-Remy](https://github.com/Patrick-Remy) in [#&#8203;10206](https://github.com/vimeo/psalm/pull/10206) - handle instanceof $this by [@&#8203;orklah](https://github.com/orklah) in [#&#8203;11286](https://github.com/vimeo/psalm/pull/11286) ##### Docs - Fix key type in PossiblyUndefinedStringArrayOffset.md by [@&#8203;emmanuelGuiton](https://github.com/emmanuelGuiton) in [#&#8203;11277](https://github.com/vimeo/psalm/pull/11277) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.6.0...6.6.1> ### [`v6.6.0`](https://github.com/vimeo/psalm/releases/tag/6.6.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.5.1...6.6.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Add ClassMustBeFinal issue by [@&#8203;danog](https://github.com/danog) in [#&#8203;11279](https://github.com/vimeo/psalm/pull/11279) - Enable MissingOverrideAttribute on all PHP versions by [@&#8203;danog](https://github.com/danog) in [#&#8203;11284](https://github.com/vimeo/psalm/pull/11284) ##### Fixes - Fix trait issue with MissingOverrideAttribute by [@&#8203;danog](https://github.com/danog) in [#&#8203;11284](https://github.com/vimeo/psalm/pull/11284) - Enable attribute parsing on versions lower than 8.0 by [@&#8203;danog](https://github.com/danog) in [#&#8203;11284](https://github.com/vimeo/psalm/pull/11284) - Fix type assertion for Arithemtic addition and subtraction by [@&#8203;KevinVanSonsbeek](https://github.com/KevinVanSonsbeek) in [#&#8203;11269](https://github.com/vimeo/psalm/pull/11269) - Fix config error in LSP by [@&#8203;tm1000](https://github.com/tm1000) in [#&#8203;11255](https://github.com/vimeo/psalm/pull/11255) - Replace felixfbecker/advanced-json-rpc with maintained fork by [@&#8203;danog](https://github.com/danog) in [#&#8203;11282](https://github.com/vimeo/psalm/pull/11282) ##### Docs - Improve stub docs by [@&#8203;danog](https://github.com/danog) in [#&#8203;11276](https://github.com/vimeo/psalm/pull/11276) ##### Internal changes - Reorganize tools by [@&#8203;danog](https://github.com/danog) in [#&#8203;11278](https://github.com/vimeo/psalm/pull/11278) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.5.1...6.6.0> ### [`v6.5.1`](https://github.com/vimeo/psalm/releases/tag/6.5.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.5.0...6.5.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Specify minimum PHP patch release in composer.json as well by [@&#8203;danog](https://github.com/danog) in [#&#8203;11271](https://github.com/vimeo/psalm/pull/11271) - Bump `symfony/filesystem` by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;11273](https://github.com/vimeo/psalm/pull/11273) ##### Internal changes - Enable opcache if installed by [@&#8203;danog](https://github.com/danog) in [#&#8203;11274](https://github.com/vimeo/psalm/pull/11274) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.5.0...6.5.1> ### [`v6.5.0`](https://github.com/vimeo/psalm/releases/tag/6.5.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.4.1...6.5.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - The [psalm.dev](https://psalm.dev) REPL now supports the `disableVarParsing` config by [@&#8203;danog](https://github.com/danog) - Add allFunctionsGlobal and allConstantsGlobal options, useful for legacy codebases which do not use Composer to preload functions and constants by [@&#8203;danog](https://github.com/danog) in [#&#8203;11259](https://github.com/vimeo/psalm/pull/11259) ##### Fixes - Fix deep scanning of files light-scanned in main thread by [@&#8203;danog](https://github.com/danog) in [#&#8203;11264](https://github.com/vimeo/psalm/pull/11264) - Template inference bugfix by [@&#8203;danog](https://github.com/danog) in [#&#8203;11267](https://github.com/vimeo/psalm/pull/11267) - Force usage of latest patch version of PHP to avoid PHP bugs by [@&#8203;danog](https://github.com/danog) in [#&#8203;11270](https://github.com/vimeo/psalm/pull/11270) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.4.1...6.5.0> ### [`v6.4.1`](https://github.com/vimeo/psalm/releases/tag/6.4.1) [Compare Source](https://github.com/vimeo/psalm/compare/6.4.0...6.4.1) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Fixes - Disable uv to avoid fork() issues by [@&#8203;danog](https://github.com/danog) in [#&#8203;11250](https://github.com/vimeo/psalm/pull/11250) - Fix issue with insufficient shared memory for interned strings buffer by [@&#8203;yethee](https://github.com/yethee) in [#&#8203;11243](https://github.com/vimeo/psalm/pull/11243) - Simplify redis return types by [@&#8203;danog](https://github.com/danog) in [#&#8203;11256](https://github.com/vimeo/psalm/pull/11256) - Improve performance and accuracy of types comparison by [@&#8203;danog](https://github.com/danog) in [#&#8203;11257](https://github.com/vimeo/psalm/pull/11257) - Fix TemplateInferredTypeReplacer by [@&#8203;VincentLanglet](https://github.com/VincentLanglet) in [#&#8203;11258](https://github.com/vimeo/psalm/pull/11258) ##### Internal changes - Allow sebastian/diff v7 by [@&#8203;liviuconcioiu](https://github.com/liviuconcioiu) in [#&#8203;11260](https://github.com/vimeo/psalm/pull/11260) #### New Contributors - [@&#8203;liviuconcioiu](https://github.com/liviuconcioiu) made their first contribution in [#&#8203;11260](https://github.com/vimeo/psalm/pull/11260) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.4.0...6.5.0> ### [`v6.4.0`](https://github.com/vimeo/psalm/releases/tag/6.4.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.3.0...6.4.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> #### What's Changed ##### Features - Add forbiddenConstants config by [@&#8203;danog](https://github.com/danog) in [#&#8203;11245](https://github.com/vimeo/psalm/pull/11245) - Add --review shortcut for psalm.phar by [@&#8203;danog](https://github.com/danog) in [#&#8203;11246](https://github.com/vimeo/psalm/pull/11246) ##### Fixes - Add array function parameter type providers by [@&#8203;danog](https://github.com/danog) in [#&#8203;11247](https://github.com/vimeo/psalm/pull/11247) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.3.0...6.4.0> ### [`v6.3.0`](https://github.com/vimeo/psalm/releases/tag/6.3.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.2.0...6.3.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> This release adds the new [psalm-review](https://psalm.dev/docs/running_psalm/command_line_usage/#reviewing-issues-in-your-ide-of-choice) tool! #### What's Changed ##### Features - Add new psalm-review tool by [@&#8203;danog](https://github.com/danog) in [#&#8203;11237](https://github.com/vimeo/psalm/pull/11237) ##### Fixes - Fix return type of yield from by [@&#8203;danog](https://github.com/danog) in [#&#8203;11236](https://github.com/vimeo/psalm/pull/11236) - Fix standalone block analysis by [@&#8203;danog](https://github.com/danog) in [#&#8203;11234](https://github.com/vimeo/psalm/pull/11234) - Fix indirect magic property usage by [@&#8203;danog](https://github.com/danog) in [#&#8203;11238](https://github.com/vimeo/psalm/pull/11238) - Allow iterating over generator with void send() type by [@&#8203;danog](https://github.com/danog) in [#&#8203;11240](https://github.com/vimeo/psalm/pull/11240) - Fix closure typehints in arrays by [@&#8203;danog](https://github.com/danog) in [#&#8203;11239](https://github.com/vimeo/psalm/pull/11239) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.2.0...6.3.0> ### [`v6.2.0`](https://github.com/vimeo/psalm/releases/tag/6.2.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.1.0...6.2.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> This release was possible thanks to a [Psalm support contract](https://psalm.dev/support)! This release adds the new LiteralKeyUnshapedArray issue, controlled by the [disallowLiteralKeysOnUnshapedArrays](https://psalm.dev/docs/running_psalm/configuration/#disallowliteralkeysonunshapedarrays) configuration flag (false by default), useful to enforce usage of shaped arrays instead of generic arrays. #### What's Changed ##### Features - Add LiteralKeyUnshapedArray issue by [@&#8203;danog](https://github.com/danog) in [#&#8203;11230](https://github.com/vimeo/psalm/pull/11230) - Periodic logging for long processing by [@&#8203;danog](https://github.com/danog) in [#&#8203;11231](https://github.com/vimeo/psalm/pull/11231) ##### Fixes - Fix storage should not be null errors by [@&#8203;danog](https://github.com/danog) in [#&#8203;11232](https://github.com/vimeo/psalm/pull/11232) - Avoid further issues caused by duplicate class declarations by [@&#8203;danog](https://github.com/danog) in [#&#8203;11233](https://github.com/vimeo/psalm/pull/11233) - Parse uppercase-string by [@&#8203;VincentLanglet](https://github.com/VincentLanglet) in [#&#8203;11228](https://github.com/vimeo/psalm/pull/11228) **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.1.0...6.2.0> ### [`v6.1.0`](https://github.com/vimeo/psalm/releases/tag/6.1.0) [Compare Source](https://github.com/vimeo/psalm/compare/6.0.0...6.1.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> This release was possible thanks to a [Psalm support contract](https://psalm.dev/support)! This release greatly improves multithreaded mode, fixing some nasty issues and greatly improving efficiency, thanks to efficient task scheduling powered by amphp/parallel (& some custom code to allow usage of copy-on-write optimizations with forks instead of spawning new processes). This release also adds a runtime check to prevent Psalm from running on Linux systems where VM overcommitting is *disabled*: Psalm makes heavy use of VM overcommitting (specifically during forking in multithreaded mode) to greatly reduce RAM usage and improve performance.\ Note that in the vast majority of Linux systems, VM overcommitting is already *enabled by default*. #### What's Changed ##### Features - Refactor Pool for much more efficient multithreaded parallelism by [@&#8203;danog](https://github.com/danog) in [#&#8203;11219](https://github.com/vimeo/psalm/pull/11219) - Add support for --scan-threads CLI and config flag by [@&#8203;danog](https://github.com/danog) in [#&#8203;11216](https://github.com/vimeo/psalm/pull/11216) - Log files being processed for too long by [@&#8203;danog](https://github.com/danog) in [#&#8203;11225](https://github.com/vimeo/psalm/pull/11225) - Add VM overcommit warning by [@&#8203;danog](https://github.com/danog) in [#&#8203;1121](https://github.com/vimeo/psalm/pull/1121) ##### Fixes - Fix language server by [@&#8203;danog](https://github.com/danog) in [#&#8203;11221](https://github.com/vimeo/psalm/pull/11221) ##### Internal changes - Improve default opcache options by [@&#8203;danog](https://github.com/danog) in [#&#8203;11222](https://github.com/vimeo/psalm/pull/11222) ##### Other changes **Full Changelog**: <https://github.com/vimeo/psalm/compare/6.0.0...6.1.0> ### [`v6.0.0`](https://github.com/vimeo/psalm/releases/tag/6.0.0): Psalm v6 [Compare Source](https://github.com/vimeo/psalm/compare/5.26.1...6.0.0) <!-- Release notes generated using configuration in .github/release.yml at 6.x --> This is the first release of Psalm v6! Users are encouraged to switch to Psalm v6 right away, as v5 is not supported anymore. Also announcing Psalm's new **support model**: you can support Psalm development by requesting a support contract from [Daniil Gentili](https://daniil.it), the only active maintainer of Psalm. Support contracts can cover full integration of Psalm into existing codebases, support for Psalm issues and development of additional Psalm features. See [here »](https://daniil.it) for info, pricing and contact information. Main highlights of Psalm v6: - PHP 8.4 support - Amp v3 support - PHP-Parser v5 support - Fully overhauled [dictionaries](https://psalm.dev/docs/contributing/editing_callmaps/), for much more accurate and always up to date signatures for PHP and extension functions and methods, and much simpler PHP version upgrades. - `ignoreInternalFunctionFalseReturn` and `ignoreInternalFunctionNullReturn` are now `false` by default: this means Psalm now warns when a false/null return type of a native function is not explicitly checked. - Modernization of the codebase for higher performance. - Many other bugfixes and performance improvements. Plugin authors should consult the [changelog](https://github.com/vimeo/psalm/blob/6.x/UPGRADING.md) for info about BC-breaking changes. #### What's Changed ##### Features - Add --force-jit flag by [@&#8203;danog](https://github.com/danog) in [#&#8203;11165](https://github.com/vimeo/psalm/pull/11165) - Xpath injection detection [#&#8203;10162](https://github.com/vimeo/psalm/issues/10162) by [@&#8203;cgocast](https://github.com/cgocast) in [#&#8203;10163](https://github.com/vimeo/psalm/pull/10163) - Backed enum value changed to Atomic instead of scalar int or strings by [@&#8203;tuqqu](https://github.com/tuqqu) in [#&#8203;10165](https://github.com/vimeo/psalm/pull/10165) - Introduce NonVariableReferenceReturn issue by [@&#8203;tuqqu](https://github.com/tuqqu) in [#&#8203;10227](https://github.com/vimeo/psalm/pull/10227) - Detect DoS by sleep [#&#8203;10178](https://github.com/vimeo/psalm/issues/10178) by [@&#8203;cgocast](https://github.com/cgocast) in [#&#8203;10183](https://github.com/vimeo/psalm/pull/10183) - Introduce `DuplicateProperty` issue by [@&#8203;tuqqu](https://github.com/tuqqu) in [#&#8203;10265](https://github.com/vimeo/psalm/pull/10265) - Disable ignoreInternalFunction(False|Null)Return by default by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10211](https://github.com/vimeo/psalm/pull/10211) - Add intl extension stub by [@&#8203;braindawg](https://github.com/braindawg) in [#&#8203;10276](https://github.com/vimeo/psalm/pull/10276) - Improved type of callable-array by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;9794](https://github.com/vimeo/psalm/pull/9794) - Add progress for scanning stage by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10345](https://github.com/vimeo/psalm/pull/10345) - Allow enum cases to be global constants by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10339](https://github.com/vimeo/psalm/pull/10339) - Report unused issue handler suppressions by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10341](https://github.com/vimeo/psalm/pull/10341) - Support @&#8203;(no-)seal-(properties|methods) annotations without prefix by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10344](https://github.com/vimeo/psalm/pull/10344) - Stub constants for ZipArchive from ext-zip by [@&#8203;braindawg](https://github.com/braindawg) in [#&#8203;10332](https://github.com/vimeo/psalm/pull/10332) - Allow type aliases for static variables by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10362](https://github.com/vimeo/psalm/pull/10362) - Inherit magic methods from [@&#8203;mixin](https://github.com/mixin) by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10356](https://github.com/vimeo/psalm/pull/10356) - TaintedExtract by [@&#8203;cgocast](https://github.com/cgocast) in [#&#8203;10417](https://github.com/vimeo/psalm/pull/10417) - feat: Default baseline file by [@&#8203;jorgsowa](https://github.com/jorgsowa) in [#&#8203;10696](https://github.com/vimeo/psalm/pull/10696) - Add phpstub for amqp extension (php-amqp) by [@&#8203;mkilmanas](https://github.com/mkilmanas) in [#&#8203;11172](https://github.com/vimeo/psalm/pull/11172) - Add phpstub for amqp extension (php-amqp) by [@&#8203;mkilmanas](https://github.com/mkilmanas) in [#&#8203;11181](https://github.com/vimeo/psalm/pull/11181) ##### Fixes - Fix [#&#8203;10047](https://github.com/vimeo/psalm/issues/10047) by [@&#8203;cgocast](https://github.com/cgocast) in [#&#8203;10048](https://github.com/vimeo/psalm/pull/10048) - Respect stubs in all cases by [@&#8203;mmcev106](https://github.com/mmcev106) in [#&#8203;10092](https://github.com/vimeo/psalm/pull/10092) - Hotfix Shepard build by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10268](https://github.com/vimeo/psalm/pull/10268) - Hotfix shepard build by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10343](https://github.com/vimeo/psalm/pull/10343) - Add constants from SOAP extension to stub by [@&#8203;braindawg](https://github.com/braindawg) in [#&#8203;10333](https://github.com/vimeo/psalm/pull/10333) - Incorrectly asserting non-empty-list after combining with empty list by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;9787](https://github.com/vimeo/psalm/pull/9787) - Consistent type docblock parsing by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10326](https://github.com/vimeo/psalm/pull/10326) - Fix stub for RecursiveArrayIterator::getChildren by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10340](https://github.com/vimeo/psalm/pull/10340) - Maintain loop start val after increment/decrement by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10263](https://github.com/vimeo/psalm/pull/10263) - Method annotation fixes by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10361](https://github.com/vimeo/psalm/pull/10361) - A segment of progress was being output early as the startScanningFile… by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10360](https://github.com/vimeo/psalm/pull/10360) - Fix at in array keys by [@&#8203;danog](https://github.com/danog) in [#&#8203;10426](https://github.com/vimeo/psalm/pull/10426) - Inherit conditional returns by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10357](https://github.com/vimeo/psalm/pull/10357) - Fix iteration over weakmaps by [@&#8203;danog](https://github.com/danog) in [#&#8203;10472](https://github.com/vimeo/psalm/pull/10472) - Suppress scanning output in CI by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;10688](https://github.com/vimeo/psalm/pull/10688) - Suppress unused config suppression detection when running in partial or cache mode by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10694](https://github.com/vimeo/psalm/pull/10694) - Fix trait analysis by [@&#8203;danog](https://github.com/danog) in [#&#8203;10904](https://github.com/vimeo/psalm/pull/10904) ##### Docs - Doc typo by [@&#8203;cgocast](https://github.com/cgocast) in [#&#8203;10393](https://github.com/vimeo/psalm/pull/10393) - Fixed docblock spacing in `@psalm-internal` documentation example by [@&#8203;still-dreaming-1](https://github.com/still-dreaming-1) in [#&#8203;10467](https://github.com/vimeo/psalm/pull/10467) - Update dealing_with_code_issues.md: Minor by [@&#8203;ThomasLandauer](https://github.com/ThomasLandauer) in [#&#8203;10954](https://github.com/vimeo/psalm/pull/10954) - Fix broken links to PHPDoc Types page in documentation by [@&#8203;elazar](https://github.com/elazar) in [#&#8203;11105](https://github.com/vimeo/psalm/pull/11105) - Fix broken phpDocumentor links on Supported Annotations docs page by [@&#8203;elazar](https://github.com/elazar) in [#&#8203;11119](https://github.com/vimeo/psalm/pull/11119) ##### Internal changes - Switch to amp v3 by [@&#8203;danog](https://github.com/danog) in [#&#8203;10024](https://github.com/vimeo/psalm/pull/10024) - Psalm v6 by [@&#8203;danog](https://github.com/danog) in [#&#8203;10040](https://github.com/vimeo/psalm/pull/10040) - Make `TLiteralFloat::$value` and `TLiteralInt::$value` typed by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;9517](https://github.com/vimeo/psalm/pull/9517) - Psalm v6: strict_types=1 by [@&#8203;danog](https://github.com/danog) in [#&#8203;10044](https://github.com/vimeo/psalm/pull/10044) - V6 fixes by [@&#8203;danog](https://github.com/danog) in [#&#8203;10310](https://github.com/vimeo/psalm/pull/10310) - Remove MixedInferredReturnType by [@&#8203;robchett](https://github.com/robchett) in [#&#8203;9783](https://github.com/vimeo/psalm/pull/9783) - Merge 5.x by [@&#8203;danog](https://github.com/danog) in [#&#8203;10369](https://github.com/vimeo/psalm/pull/10369) - Improve scan progress by [@&#8203;danog](https://github.com/danog) in [#&#8203;10415](https://github.com/vimeo/psalm/pull/10415) - Merge 5.x by [@&#8203;danog](https://github.com/danog) in [#&#8203;10504](https://github.com/vimeo/psalm/pull/10504) - Apply rector fixes by [@&#8203;danog](https://github.com/danog) in [#&#8203;10305](https://github.com/vimeo/psalm/pull/10305) - Do not use JIT on windows by [@&#8203;danog](https://github.com/danog) in [#&#8203;10564](https://github.com/vimeo/psalm/pull/10564) - Let disable-extension also disable zend extensions by [@&#8203;danog](https://github.com/danog) in [#&#8203;10565](https://github.com/vimeo/psalm/pull/10565) - Merge 5.x by [@&#8203;danog](https://github.com/danog) in [#&#8203;10569](https://github.com/vimeo/psalm/pull/10569) - Merge 5.x by [@&#8203;danog](https://github.com/danog) in [#&#8203;10576](https://github.com/vimeo/psalm/pull/10576) - Remove unnecessary null type from `initialized_methods` Context property by [@&#8203;theodorejb](https://github.com/theodorejb) in [#&#8203;10610](https://github.com/vimeo/psalm/pull/10610) - Update master from 5.x by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10597](https://github.com/vimeo/psalm/pull/10597) - Update master from 5.x by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10618](https://github.com/vimeo/psalm/pull/10618) - Update master from 5.x by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10656](https://github.com/vimeo/psalm/pull/10656) - Update master from 5.x by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10684](https://github.com/vimeo/psalm/pull/10684) - Fix composer warnings by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10695](https://github.com/vimeo/psalm/pull/10695) - Update master from 5.x by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10693](https://github.com/vimeo/psalm/pull/10693) - Update master from 5.x by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10714](https://github.com/vimeo/psalm/pull/10714) - Update master from 5.x by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10750](https://github.com/vimeo/psalm/pull/10750) - Update `master` from `5.x` by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10775](https://github.com/vimeo/psalm/pull/10775) - Update `master` from `5.x` by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;10803](https://github.com/vimeo/psalm/pull/10803) - Fix the tests broken when running with Paratest by [@&#8203;weirdan](https://github.com/weirdan) in [#&#8203;11122](https://github.com/vimeo/psalm/pull/11122) - Fix grammar by [@&#8203;MoonE](https://github.com/MoonE) in [#&#8203;11154](https://github.com/vimeo/psalm/pull/11154) - Merge 5.x by [@&#8203;danog](https://github.com/danog) in [#&#8203;11164](https://github.com/vimeo/psalm/pull/11164) - Normalize callmap by [@&#8203;danog](https://github.com/danog) in [#&#8203;11174](https://github.com/vimeo/psalm/pull/11174) - Normalize callmap by [@&#8203;danog](https://github.com/danog) in [#&#8203;11175](https://github.com/vimeo/psalm/pull/11175) - Remove unnecessary array spread of temp arrays by [@&#8203;MoonE](https://github.com/MoonE) in [#&#8203;11182](https://github.com/vimeo/psalm/pull/11182) - PHP 8.4 support, dictionary refactoring by [@&#8203;danog](https://github.com/danog) in [#&#8203;11169](https://github.com/vimeo/psalm/pull/11169) - Add support for PHP 8.4 by [@&#8203;GromNaN](https://github.com/GromNaN) in [#&#8203;10928](https://github.com/vimeo/psalm/pull/10928) ##### Typos - Fix typos by [@&#8203;szepeviktor](https://github.com/szepeviktor) in [#&#8203;10963](https://github.com/vimeo/psalm/pull/10963) ##### Other changes - Update nikic/php-parser to 5.0 by [@&#8203;edsrzf](https://github.com/edsrzf) in [#&#8203;10567](https://github.com/vimeo/psalm/pull/10567) - :bug: Fix "Config supression" link by [@&#8203;homersimpsons](https://github.com/homersimpsons) in [#&#8203;11185](https://github.com/vimeo/psalm/pull/11185) #### New Contributors - [@&#8203;braindawg](https://github.com/braindawg) made their first contribution in [#&#8203;10276](https://github.com/vimeo/psalm/pull/10276) - [@&#8203;elazar](https://github.com/elazar) made their first contribution in [#&#8203;11105](https://github.com/vimeo/psalm/pull/11105) - [@&#8203;mkilmanas](https://github.com/mkilmanas) made their first contribution in [#&#8203;11172](https://github.com/vimeo/psalm/pull/11172) - [@&#8203;homersimpsons](https://github.com/homersimpsons) made their first contribution in [#&#8203;11185](https://github.com/vimeo/psalm/pull/11185) **Full Changelog**: <https://github.com/vimeo/psalm/compare/5.26.1...6.0.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTkuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjI2MC4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Update dependency vimeo/psalm to v7
Some checks failed
Static analysis / changes (pull_request) Successful in 37s
PHP / changes (pull_request) Successful in 37s
Node / changes (pull_request) Successful in 38s
Node / NPM (pull_request) Has been skipped
Node / node-summary (pull_request) Successful in 1s
Lint info.xml / info.xml lint (pull_request) Successful in 41s
PHPUnit SQLite / versions (pull_request) Successful in 5s
Static analysis / versions (pull_request) Successful in 4s
PHP / versions (pull_request) Successful in 5s
renovate/artifacts Artifact file update failure
PHPUnit SQLite / changes (pull_request) Successful in 37s
REUSE Compliance Check / reuse-compliance-check (pull_request) Successful in 7s
Static analysis / static-psalm-analysis dev-stable33 (dev-stable33, 8.5) (pull_request) Failing after 2m50s
Static analysis / static-psalm-analysis dev-stable34 (dev-stable34, 8.5) (pull_request) Failing after 2m50s
PHP / PHP 8.2 (8.2) (pull_request) Failing after 2m52s
Static analysis / static-psalm-analysis dev-stable35 (dev-stable35, 8.5) (pull_request) Failing after 3m7s
Static analysis / static-psalm-analysis-summary (pull_request) Failing after 2s
PHP / PHP 8.5 (8.5) (pull_request) Failing after 44s
PHPUnit SQLite / SQLite PHP 8.5 Nextcloud stable35 (8.5, stable35) (pull_request) Failing after 3m37s
PHP / php-summary (pull_request) Failing after 2s
PHPUnit SQLite / phpunit-sqlite-summary (pull_request) Failing after 2s
7dccbd5d69
Author
Collaborator

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: vendor-bin/psalm/composer.lock
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires vimeo/psalm ^7.0 -> satisfiable by vimeo/psalm[7.0.0].
    - vimeo/psalm 7.0.0 requires php-64bit ~8.2.27 || ~8.3.16 || ~8.4.3 || ~8.5.0 || ~8.6.0 -> your php-64bit version (8.1; overridden via config.platform, same as actual) does not satisfy that requirement.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

### ⚠️ Artifact update problem Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens: - any of the package files in this branch needs updating, or - the branch becomes conflicted, or - you click the rebase/retry checkbox if found above, or - you rename this PR's title to start with "rebase!" to trigger it manually The artifact failure details are included below: ##### File name: vendor-bin/psalm/composer.lock ``` Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires vimeo/psalm ^7.0 -> satisfiable by vimeo/psalm[7.0.0]. - vimeo/psalm 7.0.0 requires php-64bit ~8.2.27 || ~8.3.16 || ~8.4.3 || ~8.5.0 || ~8.6.0 -> your php-64bit version (8.1; overridden via config.platform, same as actual) does not satisfy that requirement. Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. ```
Some checks failed
Static analysis / changes (pull_request) Successful in 37s
PHP / changes (pull_request) Successful in 37s
Node / changes (pull_request) Successful in 38s
Node / NPM (pull_request) Has been skipped
Node / node-summary (pull_request) Successful in 1s
Lint info.xml / info.xml lint (pull_request) Successful in 41s
PHPUnit SQLite / versions (pull_request) Successful in 5s
Static analysis / versions (pull_request) Successful in 4s
PHP / versions (pull_request) Successful in 5s
renovate/artifacts Artifact file update failure
PHPUnit SQLite / changes (pull_request) Successful in 37s
REUSE Compliance Check / reuse-compliance-check (pull_request) Successful in 7s
Static analysis / static-psalm-analysis dev-stable33 (dev-stable33, 8.5) (pull_request) Failing after 2m50s
Static analysis / static-psalm-analysis dev-stable34 (dev-stable34, 8.5) (pull_request) Failing after 2m50s
PHP / PHP 8.2 (8.2) (pull_request) Failing after 2m52s
Static analysis / static-psalm-analysis dev-stable35 (dev-stable35, 8.5) (pull_request) Failing after 3m7s
Static analysis / static-psalm-analysis-summary (pull_request) Failing after 2s
PHP / PHP 8.5 (8.5) (pull_request) Failing after 44s
PHPUnit SQLite / SQLite PHP 8.5 Nextcloud stable35 (8.5, stable35) (pull_request) Failing after 3m37s
PHP / php-summary (pull_request) Failing after 2s
PHPUnit SQLite / phpunit-sqlite-summary (pull_request) Failing after 2s
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/vimeo-psalm-7.x:renovate/vimeo-psalm-7.x'
git switch 'renovate/vimeo-psalm-7.x'

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/vimeo-psalm-7.x'
git switch 'renovate/vimeo-psalm-7.x'
git rebase 'main'
git switch 'main'
git merge --ff-only 'renovate/vimeo-psalm-7.x'
git switch 'renovate/vimeo-psalm-7.x'
git rebase 'main'
git switch 'main'
git merge --no-ff 'renovate/vimeo-psalm-7.x'
git switch 'main'
git merge --squash 'renovate/vimeo-psalm-7.x'
git switch 'main'
git merge --ff-only 'renovate/vimeo-psalm-7.x'
git switch 'main'
git merge 'renovate/vimeo-psalm-7.x'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lukasdotcom/nextcloud-shortcuts!23
No description provided.