Let's start with the history.
When I first started developing, Anorak I started with PHP_Codesniffer to deal with checking code standards. Although it does its job well, it's very much aimed at only being used as a command line tool. I'm sure if I'd spent more time with it, that I could've gotten it to work, but it just wasn't obvious and this made me frustrated.
So in my frustration I looked for an alternative. It took me a while, but I eventually stumbled upon PHPCheckstyle. It was almost perfect. I ended up hacking on it to improve speed, add more checks and include
ArrayReporter which meant I no longer had to parse the output of the checkstyle formatted file.
A bit of time passed and during continued development of Anorak I realised that PHPChecstyle wasn't quite what I was after either. It was a pain to configure, what with it's long configuration keys and sometimes checks would output the wrong line and columns. Due to it not using any kind of AST, it meant that some check were really dodgy. It was a great tool, and over my time with it, I made some great steps with it, however I was outgrowing it.
Now what do I do? Well, I started a new project with a great developer, Marcin. Hippo is just at the beginning of its development stages but we've already made great progress:
- It uses YAML for it's configuration by default.
- Built in support for extending other configurations. This will be a godsend with PSR.
- It uses a custom built Tokenizer which is also at the beginning, but making great progress.
- Checks can use either the token list or the abstract syntax tree to enable a really comprehensive understanding of the source code.
- We support multiple three output formats:
- It's really fast.
Here is Hippo, checking itself - currently with only two checks:
$ time ./hippo ./src -q real 0m0.614s user 0m0.588s sys 0m0.023s
Hippo is progressing really well. There is a lot left to do, dozens of checks, better AST support and an improved Tokenizer to implement.
Our end goal here is to provide the PHP community with a great standards checking tool. Please feel free to fork, modify and improve the source!