Skip to content

PHPDoc issue in DuplicateKeyException #73

@ondrejmirtes

Description

@ondrejmirtes

When catching DuplicateKeyException, static analysis think there's no 'key' key:

 ------ ---------------------------------------------------------------------------------------------
  Line   src/Composer/Factory.php
 ------ ---------------------------------------------------------------------------------------------
  305    Offset 'key' does not exist on array(?'text' => string, ?'token' => string, ?'line' => int,
         ?'loc' => array, ?'expected' => array).
 ------ ---------------------------------------------------------------------------------------------

(when analysing composer/composer)

/cc @staabm

Also, if you're using just PHPStan, I'd recommend prefixing PHPDocs with @phpstan- instead of @psalm- because PHPStan ignores any PHPDoc parsing issues in @psalm- prefixed tags because of forward compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions