== Why is this an issue?

:operationName: function

include::../description.adoc[]

=== Exceptions

This rule doesn't raise an issue on empty methods in abstract classes.

[source,php]
----
abstract class Animal {
  public function speak() {}  // default implementation ignored
}
----

== How to fix it

=== Code examples

==== Noncompliant code example

[source,php,diff-id=1,diff-type=noncompliant]
----
public function shouldNotBeEmpty() {  // Noncompliant - method is empty
}

public function notImplemented() {  // Noncompliant - method is empty
}

public function emptyOnPurpose() {  // Noncompliant - method is empty
}
----

==== Compliant solution

[source,php,diff-id=1,diff-type=compliant]
----
public function shouldNotBeEmpty() {
  doSomething();
}

public function notImplemented() {
  throw new Exception('notImplemented() cannot be performed because ...');
}

public function emptyOnPurpose() {
  // comment explaining why the method is empty
}
----

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]

endif::env-github,rspecator-view[]
