github vimeo/psalm 7.17.0

2 hours ago

What's Changed

Features

  • Report the functions and classes of extensions composer.json doesn't declare by @danog in #14234
  • Shepherd: Send baselined and info issue counts and analysis settings to shepherd by @alies-dev in #14673
  • Shepherd: Write the Shepherd report to a file with --shepherd=file:// by @alies-dev in #14729

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

  • CI: assign pull request author as assignee by @alies-dev in #14665
  • Share the left and right side copies of a few operand checks by @orklah in #14695
  • Build the PHP 8.6 stub image, with grpc by @orklah in #14694
  • Build the PHP 8.6 stub image by @danog in #14692
  • Factor the mixed-count guard into StatementsAnalyzer::shouldCountMixed() by @orklah in #14700
  • Add job timeouts to the test workflows by @orklah in #14732
  • Set the CI test time limit in the generated PHPUnit config by @orklah in #14733
  • Fork every pool worker before Pool::run() submits a task by @orklah in #14736
  • Merge CastAnalyzer::castIntAttempt and castFloatAttempt by @orklah in #14720
  • Describe the argument-count deprecations of builtin functions in a table by @orklah in #14697

Full Changelog: 7.16.0...7.17.0

Don't miss a new psalm release

NewReleases is sending notifications on new releases.