title: PhpStorm: what to do with unhandled exceptions when preconditions are met
body: <p>I really like the PhpStorm inspection tools. They help me a lot to write better code. Now I have the following situation and I am asking myself what's the best way to deal with such situations.</p>
  
  <p>I have a function f with some precondition, for example like in the following code:</p>
  
  <pre><code>/**
   * @param int $x
   * @throws PreconditionException x is negative
   */
   public function f(int $x): int
   {
     if ($x &lt; 0) {
       throw new PreconditionException("the input x is negative");
     }
   }
  </code></pre>
  
  <p>Then I use this function somewhere lets say the following:</p>
  
  <pre><code>f(5);
  </code></pre>
  
  <p>Now PhpStorm warns me with "Unhandled exception". But in this case I know that the exception will not be thrown, so adding a try block makes not really sense. Should I simply ignore this warning or what's the best way to deal with that?</p>