Tool for cleaning up PHP code - HTML Tidy like

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • xio

    Tool for cleaning up PHP code - HTML Tidy like

    Hi,

    I have a bunch of files with PHP code. These files were written by
    multiple developers with different coding styles and is just so
    painful to read them.

    Could you recommend any tool I could use to clean up PHP code -
    something like "HTML Tidy for PHP"

    Thanks,
    Xio

  • Michael Placentra II

    #2
    Re: Tool for cleaning up PHP code - HTML Tidy like

    xio wrote:
    Hi,
    >
    I have a bunch of files with PHP code. These files were written by
    multiple developers with different coding styles and is just so
    painful to read them.
    >
    Could you recommend any tool I could use to clean up PHP code -
    something like "HTML Tidy for PHP"
    >
    Thanks,
    Xio
    >
    I've often dreamed of using something like that on my own code (I've changed my coding style many times over the past few years). I considered making a PHP script to to that, it would not be impossible to do. Maybe you can get one of your developers to make that.

    -Mike PII

    Comment

    • Colin McKinnon

      #3
      Re: Tool for cleaning up PHP code - HTML Tidy like

      xio wrote:
      >
      I have a bunch of files with PHP code. These files were written by
      multiple developers with different coding styles and is just so
      painful to read them.
      >
      Could you recommend any tool I could use to clean up PHP code -
      something like "HTML Tidy for PHP"
      >
      vim does a pretty good job of sorting out whitespace layout but can't help
      with deprecated syntax, bad naming, comment density etc.

      There is a PHP style checker (apart from PHPlint which is all about
      enforcing strict typing) in the PEAR repository called php_codesniffer .

      HTH

      C.

      Comment

      Working...