1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 09:19:40 +01:00
psalm/docs/running_psalm/issues/MissingOverrideAttribute.md
2024-02-04 21:07:22 +13:00

538 B

MissingOverrideAttribute

Emitted when the config flag ensureOverrideAttribute is set to true and a method on a child class or interface overrides a method on a parent, but no Override attribute is present.

<?php

class A {
    function receive(): void
    {
    }
}

class B extends A {
    function receive(): void
    {
    }
}

Why this is bad

Having an Override attribute on overridden methods makes intentions clear. Read the PHP RFC for more details.