1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 08:49:52 +01:00
psalm/docs/running_psalm/issues/InvalidInterfaceImplementation.md
Bruce Weirdan 085e8f6fb2
Forbid implementing some interfaces
- `Throwable` can only be implemented when classes extend one of
  `Exception` or `Error`
- `UnitEnum` and `BackedEnum` cannot be implemented by user-defined
  classes

Refs vimeo/psalm#7722
2023-02-12 02:48:50 -04:00

277 B

InvalidInterfaceImplementation

Emitted when trying to implement interface that cannot be implemented (e.g. Throwable, UnitEnum, BackedEnum).

<?php

class E implements UnitEnum 
{
    public static function cases(): array 
    {
        return []; 
    }
}