== Why is this an issue?

:func_name: method

include::../description.adoc[]

[source,php,diff-id=1,diff-type=noncompliant]
----
class A {
    private const CODE = "secret";

    public function getCode() {
        doTheThing();
        return A::CODE;
    }

    public function getName() {  // Noncompliant: duplicates getCode
        doTheThing();
        return A::CODE;
    }
}
----

include::../inter.adoc[]

[source,php,diff-id=1,diff-type=compliant]
----
class A {
    private const CODE = "secret";

    public function getCode() {
        doTheThing();
        return A::CODE;
    }

    public function getName() { // Intent is clear
        return $this->getCode();
    }
}
----

include::../exceptions.adoc[]

Additionally, accessors consisting of a single statement are ignored, if this statement does one of the following:

* Return `null` or an empty list `[]`
* Throw an exception
* Return a newly created object

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

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

include::../message.adoc[]

include::../highlighting.adoc[]

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

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

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