Active
Project:
Coder
Version:
8.3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Dec 2022 at 20:19 UTC
Updated:
28 Sep 2026 at 23:25 UTC
Jump to comment: Most recent
This code will cause a UnusedPrivateMethod warning:
/**
* Coder test.
*/
class Test {
/**
* Public.
*/
public function publicMethod() {
return self::privateMethod();
}
/**
* Private.
*/
private function privateMethod() {
return TRUE;
}
}
If privateMethod() is marked static, the problem goes away. A person cleaning up their code might just remove the apparently-used method and thereby break their code.
Comments
Comment #2
twiesing commentedI have a similar issue, I am calling a private method on another instance of the same class only, and it gets flagged.
Concretely I have a private method I am invoking inside a postLoad function of a custom entity class.