github vimeo/psalm 7.23.0

one hour ago

What's Changed

Features

  • Narrow array element types from in_array() checks by @rvyyv-n in #15152
  • Make Union::isBool() true when every member is a bool, like isInt() by @orklah in #15164
  • Check the callback parameters of array_walk() and array_walk_recursive() by @backendArchitect in #15167
  • feat(docblock): add @psalm-overload for constructors by @jirkace in #13355
  • feat(types): keep a union of sealed array shapes apart by @jirkace in #15156

Fixes

  • Don't select the indentation of a tagless comment line by @orklah in #15155
  • A BSON value such as an ObjectId can't carry the nosql taint by @danog in #15099
  • Deprecate Union::isSingle(), which reads only the first of several literals by @orklah in #15157
  • Don't give back the taints narrowed away to a mixed variable a branch only narrowed by @danog in #15163
  • fix(messages): PossiblyFalseArgument says 'possibly false value provided' by @ARAYN7011 in #15151
  • perf(match): analyse the arm conditions of a long match one by one by @jirkace in #15161
  • perf(types): compare an enum case only with the container's case of the same key by @jirkace in #15162
  • perf(array): skip comparing two different literal keys when forgetting aliased offsets by @jirkace in #15154
  • fix(reconciler): report isset and ?? of an array offset that always exists by @jirkace in #12633
  • perf(arithmetic): combine the results of pairs of literals once by @orklah in #15171
  • fix(int-mask): a wildcard, a generic or an intersection of global constants is an InvalidDocblock by @MikeFTV in #15022
  • fix(purity): calling a closure that may write properties forgets memoized method results by @shu-chen-dot-ca in #15046
  • Require only the list items up to the smallest key of a union-key assertion by @orklah in #15173
  • fix(array): ??= creates a key missing from a sealed shape instead of reporting it by @jirkace in #14573
  • Read the analysed PHP version from composer.json config.platform.php by @orklah in #15179
  • Don't report an extension a declared extension requires by @orklah in #15182
  • fix(array): an offset write keeps the values of the other keys possibly empty by @orklah in #15184
  • Resolve namespace-relative names (namespace\Foo) in docblocks by @alies-dev in #15177
  • Keep the type of a variable defined in a loop that may not run or only before a break by @orklah in #15181
  • Fix receiver type arguments in closure params and in the bounds of method templates by @orklah in #15183
  • fix(traits): parent::class, parent::CONST and parent::$prop in a trait are the ones of the class using it by @jirkace in #15015
  • fix(assertion): !== against an object keeps a wider iterable or callable by @jirkace in #14364
  • fix(destructuring): assign a destructured item to an offset or a property like a plain assignment by @jirkace in #14544
  • fix(calls): a call of a callable array or Class::method string returns what the method returns by @jirkace in #14511
  • fix(property-fetch): a property named by one of several literals has the type of each by @jirkace in #14547
  • Keep callable parameter names in @return apart from the function parameters by @alies-dev in #15178
  • Don't analyse a class declaration skipped under a false existence guard by @orklah in #15199
  • fix(stubs): SoapClient::__setLocation takes and returns a nullable string by @jirkace in #15010
  • Fix crash on key-of of a template bounded by another template by @jay23606 in #15212
  • Keep checking a method template's bound against an argument built in place by @orklah in #15214
  • A property keeps its own type where it is accessible, not that of a @Property by @orklah in #15210
  • fix(config): don't follow a symlink cycle in a ** pattern by @jirkace in #14559
  • fix(algebra): the negation of a specific array next to an asserted array keeps the non-arrays by @jirkace in #14427
  • fix(templates): the class-string of a template's bound only may be the class-string of the template by @jirkace in #14625
  • fix(taint): an override keeps its own taint sinks when the documenting parent method has templates by @jirkace in #14504
  • fix(taint): strval, implode and vsprintf return what __toString of their objects returns by @jirkace in #14452
  • fix(callables): interfaces and non-final classes may be callable by @jirkace in #14455
  • fix(types): an intersection has the properties of all its classes and object shapes by @jirkace in #14458
  • fix(internal): a class reaching its own members is not outside its restriction by @jirkace in #14374
  • fix(docblock): a conditional on a param in an inline @var is the one of the return type by @jirkace in #14501
  • fix(properties): @internal and @psalm-internal on a promoted property by @jirkace in #15013
  • Give AfterMethodCallAnalysis the static call a forwarded call was written as by @orklah in #15216
  • fix(include): an empty array may be filled by an include that is not analyzed by @jirkace in #15189
  • Keep static intersections bound to their receiver by @orklah in #15215
  • Report a possibly undefined offset after isset() on an unsealed shape by @orklah in #15219
  • Report impossible is_*() and instanceof checks of literals and return values by @orklah in #15221
  • Let a condition narrow arrays that can both be empty and object shapes to non-final classes by @orklah in #15229
  • Give each restarted Psalm process its own opcache on Windows by @alies-dev in #15234

Internal changes

  • Run base and head side by side in perf jobs by @orklah in #15218

New Contributors

Full Changelog: 7.22.1...7.23.0

Don't miss a new psalm release

NewReleases is sending notifications on new releases.