N
N
Neopitniy2020-01-10 15:22:49
phpstorm
Neopitniy, 2020-01-10 15:22:49

How to remove obscure underlines?

The class has a method for throwing exceptions

class Test{
  /** @throws Exception */
  private function error($txt){
    throw new Exception($txt);
  }

  public function method1(){
    $this->error('текст ошибки');
  }
}

Advise how to remove:
1. Underline $txt argument in brackets and underline $this-> error ();
2. Is it normal to make an internal method, a wrapper? Or is it more correct in the method, during an error, to immediately write throw new Exception('error text');

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question