1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 10:38:49 +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

16 lines
277 B
Markdown

# InvalidInterfaceImplementation
Emitted when trying to implement interface that cannot be implemented (e.g. `Throwable`, `UnitEnum`, `BackedEnum`).
```php
<?php
class E implements UnitEnum
{
public static function cases(): array
{
return [];
}
}
```