Seldaek / jsonlint

JSON Lint for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHPDoc issue in DuplicateKeyException

ondrejmirtes opened this issue · comments

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.