title: PHP CodeSniffer: use of self::$types inside closure
body: <p>Running PHP CodeSniffer on the below snippet:</p>
  
  <pre><code>return array_filter($methods, function ($method) {
      return in_array(
          strtolower($method['type']),
          self::$types
      );
  });
  </code></pre>
  
  <p>I get this error message:</p>
  
  <blockquote>
    <p>Use of self::$types inside closure.</p>
  </blockquote>
  
  <p>What exactly is the error reported (why I can't use <code>self::$types</code> inside the closure) and how to solve it?</p>
  
  <p><strong>Note</strong>: the code is perfectly working anyway. The reported error is from CodeSniffer (not a PHP error).</p>