Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the correct way to handle empty abstract method parameters? #1722

Open
utdrmac opened this issue Jan 10, 2025 · 0 comments
Open

What's the correct way to handle empty abstract method parameters? #1722

utdrmac opened this issue Jan 10, 2025 · 0 comments

Comments

@utdrmac
Copy link

utdrmac commented Jan 10, 2025

Consider the following:

interface Foo {
  public function addSomething(string $message): void
}

class Bar implements Foo {
  public function addSomething(string $message): void {
    // not implemented for this class
  }
}

Assume there are other classes that implement Foo where addSomething does work with the passed parameter. I get this error in phpcs:

906 | ERROR | [ ] Unused parameter $message. SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter

What's the correct way to resolve this? I feel like adding a phpcs:ignore above each function adds comment bloat, but if that's the correct way, I guess I'll do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant