An unused private method that implements an abstract from a trait

Hello! I wrote next code:

trait SomeTrait {

  private function useAbstractMethod()

  {

    return $this->someFunction()

  }

  abstract protected function someFunction();

}

class SomeClass

{

  use SomeTrait;

 

  public function doSomething()

  {

    echo $this->useAbstractMethod();

  }

  private function someFunction() // Here PHPStorm show hint, that function is unused

  {

     return 'Hello, JetBrains!';

  }

}

 

With this code show hint "Unused private method..." for "someFunction" in SomeClass. Only if it method is private

 

 

PhpStorm 2017.2
Build #PS-172.3317.83, built on July 18, 2017
JRE: 1.8.0_152-release-915-b5 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.8.0-59-generic

1
1 comment

Hi there,

At first glance (did not looked into nuances/details) it seems to be one of these:

Have a look.

Watch those tickets (star/vote/comment) to get notified on any progress.

0

Please sign in to leave a comment.