github vimeo/psalm 7.20.0

52 minutes ago

What's Changed

Features

  • Database taints: @psalm-database-query ... readonly for methods that can only run queries that read by @danog in #14860
  • Trust a path that starts with a directory: it isn't a server, and realpath()'s is in the directory by @danog in #14171
  • Only report a value in an XPath string literal if it can hold a quote by @danog in #14174
  • Add Codebase::addTaintedCall() to wire calls into the taint graph, and an Expr-less call taint event by @danog in #13658
  • feat(docblock): add @psalm-overload for the functions that behave by their arguments by @jirkace in #13353
  • feat(docblock): add @psalm-overload for methods and static methods by @jirkace in #13354

Fixes

  • Don't treat a shared Union slot key as scalar containment by @orklah in #14925
  • Check types by their atomics instead of their text by @orklah in #14920
  • Emit native array return type for properties-of types in psalter by @lyn1dev in #14930
  • Stop deriving displayed and generated type text from Atomic::getKey() by @orklah in #14923
  • phpClickHouse stub: what the queries store and read, for the database taints by @danog in #14861
  • Database taints: rows inserted as a list store their values in their own columns by @danog in #14853
  • Database taints: ClickHouse clauses after the tables of a SELECT and {name:Type} query parameters by @danog in #14854
  • Write string literals of types so that they read back as the same string by @orklah in #14921
  • Declare only the classes of an intersection natively by @orklah in #14918
  • Database taints: INSERT ... FORMAT (ClickHouse) stores its data in the listed columns by @danog in #14859
  • Write native types that hold exactly the values of the type by @orklah in #14917
  • Keep different conditionals, floats and template class-strings apart in a union by @orklah in #14919
  • Database taints: the SQL of sprintf() with a literal format is parsed by @danog in #14858
  • Database taints: ALTER TABLE ... UPDATE (ClickHouse) stores as an UPDATE does by @danog in #14857
  • Database taints: a query in a variable starts with what the analysis knows it starts with by @danog in #14856
  • Give decoded taints back and read escape flags soundly from literal types by @danog in #13642
  • Analyze the methods of a class declared inside a statement in a namespace by @danog in #13654
  • Unlink the result of gettype() from its variable when the variable changes by @orklah in #14937
  • Key equality assertions by the exact type compared with by @orklah in #14938
  • Parenthesise a union written before [] in a docblock by @orklah in #14935
  • Compare the intersected types in equals() and when an iterable intersection is expected by @orklah in #14944
  • fix(types): bound $int & by the non-negative operand by @jirkace in #14507
  • fix(reconciler): report the negation of an array type assertion that always holds by @jirkace in #14529
  • fix(arrays): isset() of a string offset of an array with int keys is no invalid offset by @jirkace in #14652
  • fix(types): check a literal array against callable-array by @jirkace in #13424
  • fix(loops): a loop whose counter starts beyond every value of an int bound is entered by @jirkace in #14543
  • fix(templates): localize the interface param type for a method a class takes from a trait by @jirkace in #14459
  • fix(constants): a constant read with late static binding has its native type by @jirkace in #14596
  • fix(types): a template intersected with Stringable converts to a string by @jirkace in #14471
  • fix(loops): a do-while condition on an item of a mixed variable doesn't hold after the loop by @jirkace in #14584
  • fix(properties): expand self and static of a property type for the class read, resolve type variables in get_object_vars() by @jirkace in #14512
  • fix(initialisation): a final class initialises properties through the trait methods it calls by @jirkace in #14566
  • fix(templates): an argument with no part of the bound binds the parts of the bound it contains by @jirkace in #14582
  • Replace a class-string-map's template by its bound when it is combined into another array by @orklah in #14934
  • fix(coalesce): any expression on the left of ?? is evaluated into a temporary variable by @jirkace in #14591
  • fix(context): keep refinements of readonly properties after calls when property assignments are forgotten by @jirkace in #14571
  • Don't treat autoload-dev code that autoload also loads as unshipped by @danog in #14936

Internal changes

  • Write each type's id instead of reusing its union key by @orklah in #14922

New Contributors

Full Changelog: 7.19.0...7.20.0

Don't miss a new psalm release

NewReleases is sending notifications on new releases.