title: PHP automated coding standards fixer for non-hanging braces?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/785287/are-there-any-free-cmd-line-scripts-which-can-re-format-php-source-code">Are there any free cmd-line scripts which can re-format PHP source-code?</a>  </p>
  </blockquote>
  
  
  
  <p>I've been evaluating several coding standards fixers to run on our code. This is to perform some auto-fixing on legacy code which uses deprecated things like perl-style comments.</p>
  
  <p>The most useful fixer I have used so far is php-tidy which is found here: <a href="http://phptidy.berlios.de/" rel="nofollow noreferrer">http://phptidy.berlios.de/</a></p>
  
  <p>This tries to conform to the PEAR standard, which is almost exactly what I need, except that I want non-hanging braces for control structures. </p>
  
  <p>Can anyone point me a (linux-based) command-line tool that can apply a fixer to use the ANSI style of braces?:</p>
  
  <pre><code>function nice_brace()
  {
      if (isset($nicebrace))
      {
          // I like non-hanging braces
      }
  }
  </code></pre>
  
  <p>Rather than the PEAR/Zend style:</p>
  
  <pre><code>function ugly_brace() {
      if (isset($ugly_brace)) {
          // I find this code harder to read
      }
  }
  </code></pre>
  
  <p>Edit: For others looking for something similar, check this script out: <a href="https://raw.github.com/gist/366837/25713637b6f2f9e1ec63abf3233142765df4b931/phpbb-reformat.pl" rel="nofollow noreferrer">https://raw.github.com/gist/366837/25713637b6f2f9e1ec63abf3233142765df4b931/phpbb-reformat.pl</a></p>
  
  <p>Many thanks</p>