CodeSniffer

codesniffer

Lazy Coding In PHP; A Mini Rant

Tuesday, January 4, 2011 - 13:44

If there is one thing in the PHP world that really annoys me it's programmers writing what I call "lazy code". This is code that works but takes the least amount of time (generally meaning keystrokes) to create. This is almost always a bad thing as it is difficult to read, hard to change and almost always uncommented. The main problem is that PHP is quite a forgiving and fluid language in that you allows you to write code in a variety of different ways and formats.

Category: 

CodeSniffer File Doc Comment And Class Doc Comment

Tuesday, October 14, 2008 - 09:41

Yesterday I wrote two posts about CodeSniffer and a common warning that I couldn't find any decent documentation on. I thought that today I would go over something that I also had trouble finding out about, this is the file doc error. When you run CodeSniffer on a class you might find the following error being produced.

Category: 

PHP Version Not Specified Warning In CodeSniffer

Monday, October 13, 2008 - 13:49

In my last post I talked about the PHP CodeSniffer, so today I thought I would solve a common problem that doesn't seem to have any documentation. Whilst correcting a class file I had there was this one warning that just wouldn't go away.

Category: 

Write PHP Standards Compliant Code With PHP CodeSniffer

Monday, October 13, 2008 - 10:51

One of the biggest problems I have found with PHP is the reputation that it gets. This is due to the amount of abuse that the language undergoes by many developers every day. They write code that works, and is efficient, but trying to figure out what it does can take hours as there are no comments, and the code is generally written in any old way. PHP is quite lenient with regards to how code is written.

Category: