1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 08:49:52 +01:00
psalm/docs/running_psalm/issues/InvalidOverride.md

25 lines
359 B
Markdown
Raw Normal View History

2024-02-03 01:06:12 +01:00
# InvalidOverride
Emitted when an `Override` attribute was added to a method that does not override a method from a parent class or implemented interface.
```php
<?php
class A {
function receive(): void
{
}
}
class B extends A {
#[Override]
function recieve(): void
{
}
}
```
## Why this is bad
A fatal error will be thrown.