3

We're about to look at implementing some PHP Coding Standards in our workplace to add some consistency between all of our developers.

I've read around and seen Zend and PEAR standards etc, but what's the best way to enforce these? I've found a PHP Codesniffer plugin for netbeans, but are there any other ways I could enforce a standard, possibly CI (Continuous Integration) / Hudson or even when committing to SVN?

I was just wondering If anyone had experience or any other tools/methods I could look into?

Thanks

3 Answers 3

4

CodeSniffer is indeed the best tool for this.

There is a number of ways to use it:

Disclaimer: the linked pages are just random picks from Google on that topic. They are not to suggest to use Eclipse, SVN or Hudson. Use what you think is appropriate for your development environment.

Also see http://www.qatools.org for additional tools.

Sign up to request clarification or add additional context in comments.

1 Comment

Great! Thanks for the links. I'll have a look at possibly using pre-commit hooks or using PHPCS along-side of CI/Hudson
0

I always wanted to perform code beautification on each SVN commit via SVN hooks. Still belive it's the best & most efficient way.

Currently all team members just know that XXX is approved code beautifier and everyone supposed to use it.

Comments

0

At 2017 you have basically 3 options:

From oldest to newest (by features and codebase):

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.