Skip to content

analyze "@override" in phpdoc of methods #926

@TysonAndre

Description

@TysonAndre

https://github.com/phpDocumentor/fig-standards doesn't have any issues mentioning @override, so there's nothing to base this off of

class SubClass extends BaseClass {
    /**
     * @override
     */
    public function myMethod(){}
}

Proposed semantics:

  • If there's a concrete or abstract method in a base class, trait, or interface, then phan should not emit an issue
  • For magic method such as __call(), __set_state(), don't warn
  • If there's a phpdoc @method but no real methods, emit a different warning about intended semantics?
  • Otherwise, warn

also,

  • warn if used in an abstract method or a method declared in an interface
  • Support @phan-override as well, since the semantics may end up being specific to phan and other tools may disagree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis improves the quality of Phan's analysis of a codebase

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions