Skip to content

Unused parameters in methods in abstract classes #133

Closed
@jrfnl

Description

@jrfnl

Abstract classes can contain abstract methods which are required to be overloaded, but they can also contain empty methods which are optional to overload.

abstract class Foo
{
    // Required to be overloaded.
    abstract public function bar($param);

    // Optional to be overloaded.
    public function baz($param) {
    }
}

This standard will throw a Unused function parameter $param.(VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable) warning for the second method bax().

While technically correct, IMHO it would be sane to make an exception for these kind of "optional overload" (empty) methods in abstract classes.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions