Skip to content

TypeError it's missing from the PHPDoc @throws tag. #6786

@TheSoundOfTNT

Description

@TheSoundOfTNT

Bug report

Hi,

we deployed the latest version of PHPStan, and our log is currently full of this message:

throws checked exception TypeError but it's missing from the PHPDoc @throws tag.

TypeError is not an Exception, it is an Error. Why should it be annotated in PHPDoc?

Thank you

Tomas

Code snippet that reproduces the problem

/**
   * Mapovani hodnot na konkretni datove typy
   * @param array<string, mixed> $row
   * @return void
   */
  protected function mapping(array $row): void
  {
    $this->id = (int) $row[self::ID];
    $this->code = $row[self::CODE];
    $this->suggest = (bool) $row[self::SUGGEST];
  }  

https://phpstan.org/r/ce8074ca-a67c-4ea5-92e5-9911a6f96bfb

Expected output

No TypeError errirs

Did PHPStan help you today? Did it make you happy in any way?

Usually it makes me happy every day, but not today :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions