What's Changed
Features
- Add support for reading inheritors from a phpstan-sealed tag by @stof in #11818
- Enable the Symfony plugin for any Symfony package by @danog in #14682
- feat(override): MissingOverrideAttribute for a property, class constant or enum case that overrides a parent member by @jirkace in #14407
- feat(issues): an undefined property a @Property tag declares says how to use it by @jirkace in #14644
- feat(trace): @psalm-trace a static property by @jirkace in #14629
Fixes
- Psalm used wrong autoloader from parent directory in monorepos by @kkmuffme in #11698
- Allow setting no params with provider by @kkmuffme in #11622
- ImpureFunctionsList: Adding
curl_share_setopt,imap_timeout,imap_expungeby @ThomasLandauer in #11858 - Fix iterable union containment and conditional type inference by @andrew-demb in #13329
- [6.x] Preserve set visibility when reflecting properties by @jturbide in #12052
- [6.x] Fix: false
AmbiguousConstantInheritancefor a constant reached through a parent class and an interface by @Aerendir in #12663 - fix: class-string with template contains non-object type by @vincent4vx in #11755
- [6.x] Fork workers with the StreamSelectDriver event loop by @zonuexe in #14750
- Fix: Shepherd reports to a redirecting endpoint end in HTTP 400 by @alies-dev in #14849
- Keep the offsets a write's key cannot be by its type by @orklah in #14825
- Narrow a possibly-null mixed by isset() in an elseif like in an if by @orklah in #14393
- Keep the template of a list through a non-empty-list condition by @orklah in #14830
- Keep the bools and null loosely equal to a scalar literal by @orklah in #14823
- Treat a ternary or
matchwhose every branch is$thisas$thisby @orklah in #14818 - Report contradictions on a variable earlier clauses also mention by @orklah in #14828
- Fix variable assigned right of && in a for condition reported possibly undefined by @orklah in #14827
- Report PossiblyInvalidArgument when a union member is a parent type of the param by @orklah in #14820
- Don't treat stubbed constructors with an empty body as trivial by @orklah in #14816
- Don't report empty() on a possibly undefined bool by @orklah in #14819
- Keep the widened part of an override's native type when it inherits a param docblock type by @orklah in #14817
- Don't report checks of symbols of one extension or PHP version as redundant by @orklah in #14822
- Report MixedArrayAccess when a non-empty offset check is stored in a variable by @orklah in #14824
- Fix false
PossiblyNullReferenceafter a call with arguments in a nested nullsafe chain by @alies-dev in #14850 - fix(switch): don't leave the temporary switch subject variable in scope by @jirkace in #14569
- fix(callables): a callable(never) hint doesn't narrow a typed closure param to never by @jirkace in #14447
- fix(traits): trait constants keep the first trait's and ignore method adaptations by @jirkace in #14453
- fix(reconciliation): the negation of a nullsafe !== tells the receiver is not null by @jirkace in #14460
- fix(purity): charge __toString of strtr replacements, array_multisort string flags and unpacked implode arguments by @jirkace in #14451
- fix(array): arrays created by a nested assignment with an offset are non-empty by @jirkace in #14404
- fix(message): MixedMethodCall names the known type of object and object shapes by @jirkace in #14347
- fix(properties): localize inherited @Property types with the template arguments of the parent by @jirkace in #14530
- fix(match): match (false) narrows the variables of its conditions by @jirkace in #14354
- fix(stubs): urlencode() and rawurlencode() of a non-empty-string are non-empty by @jirkace in #14521
- fix(reconciler): keep the property types of an object narrowed to a subclass by @jirkace in #14537
- fix(loop): a while or for whose condition holds on entry is entered by @jirkace in #14419
- fix(types): I&static in a final class implementing I is that class by @jirkace in #14461
- fix(taint): read the printf format and curl options by parameter, also from unpacked arguments by @jirkace in #14454
- fix(templates): a false argument records a bound on a type variable like null by @jirkace in #14589
- fix(templates): an argument without a type binds the templates of its param to mixed by @jirkace in #14592
- fix(taint): extract() of a sealed array is no TaintedExtract, and its variables get the array's taint by @jirkace in #14601
- fix(types): get_class() combined with other strings is a non-falsy string by @jirkace in #14355
- fix(assertions): not finding a key of a generic array says nothing of the key by @jirkace in #14613
- fix(this-out): a method returning $this returns the @psalm-this-out type by @jirkace in #14639
- fix(stubs): Ds\Hashable::equals takes $obj by @jirkace in #14373
- fix(int-mask-of): a wildcard ignores the constants that are not integers by @jirkace in #14348
- fix(array-access): the offsetSet() call of a destructured or foreach target has no value to check by @jirkace in #14371
- fix(templates): an override without a docblock binds the templates of the parameter types it inherits by @jirkace in #14394
- fix(switch): exhaustive switch(true) over final classes by @jirkace in #13362
- fix(reconciler): a scalar can be identical to key-of or value-of a template bounded by array by @jirkace in #14437
- fix(cli): reject an empty value of an option that requires one by @jirkace in #14336
- Build the bundled extensions into the stub images by @danog in #14686
- fix(assertion): a truthy coalesce with a falsy default establishes the key by @jirkace in #14377
- fix(templates): inherited public members make a template of new constrainable by @jirkace in #14448
- fix(reconciler): a class that is not an enum can't be an instance of UnitEnum by @jirkace in #14526
- fix(refactor): reject destinations PHP reserves as class or constant names by @jirkace in #14617
- fix(docblock): resolve type aliases of inline docblocks in the file being analysed by @jirkace in #14627
- fix(arrays): a write under an unknown key or an append keeps the shape by @jirkace in #14642
- fix(arrays): report destructurings PHP doesn't compile and keys a sealed shape lacks by @jirkace in #14604
- fix(array-fetch): report the offset of an array fetch read and written once by @jirkace in #14540
- fix(arrays): an array plus a shape has the keys of the shape by @jirkace in #14621
- fix(constants): a class constant fetched on a variable of several classes is checked for each by @jirkace in #14593
- fix(templates): a template bound may name a template declared after it by @jirkace in #14440
- fix(isset): isset of a magic property is not decided by the type of __get() by @jirkace in #14363
- Taint analysis no longer changes the type of an array narrowed by isset() in an if by @orklah in #14893
- Treat
tap($this, $callback)as returning$thisby @orklah in #14895 - Fix false ParadoxicalCondition on a clause about a variable written in a nested loop by @orklah in #14899
- Fix array offset narrowed to never making the key optional after an if by @orklah in #14896
- Resolve type variables of items read by foreach, array fetches and destructuring by @orklah in #14897
- Print types with getId() in messages, drop getId()'s $nested by @orklah in #14903
- Loose == keeps the values PHP juggles for int, float, bool, string subtypes and templates by @orklah in #14906
- Deprecate Union::getKey() by @orklah in #14910
- Keep string refinements in docblocks written by --alter by @orklah in #14913
Internal changes
- Remove the baseline entry #11622 made unused by @alies-dev in #14304
- Agents: request a Bugbot review after every push, until it finds nothing new by @danog in #14847
- Merge 6.x into master by @orklah in #14839
- Fix the unknown-key assignment tests broken by merging #14642 and #14825 by @orklah in #14900
- Show the exact type when a Union is cast to string by @orklah in #14905
- Document the text forms of a type by @orklah in #14916
New Contributors
Full Changelog: 7.18.0...7.19.0