Why @return void is wrong in PHP documentationPutting an end to a bad practice

When documenting PHP, there are two schools of thought regarding the use of @return tags in DocBlocks when the function or method being documented doesn’t actually have a return keyword:

  1. Don’t include a @return tag.
  2. Include a @return tag with a type of void.

I’m not saying that either is wrong, but the second-one is most definitely as far from correct as you can get.

Let’s look at the reasons.
Read the reasons

Line-up Vendor Prefixed Property ValuesMake your CSS easier to scan and edit

Making code easier to read is a useful thing. I often make a point of lining up assignment operators or array values in PHP as I find it far easier to scan. I’ve now got a tip for doing something similar in CSS.

View the example and solution

Enqueued Style Sheet ExtrasFine-tuning your additional style sheets

The WP_Styles class in WordPress allows for a few extra bits of fine-tuning via the extra property, which is amended by calling add_data( $handle, $key, $value ) method on the global $wp_styles.

View what extras are available

Get a Google Developer API KeyHow to access the Web Fonts API

To get developer API (application programming interface) access to several of the Google services, you need to have an API key. This is so Google can tell who is accessing the service, and ensure that each person stays below the courtesy daily limit for the number of requests.

Here we look at how to allow access for, and get a key for, the Google Web Fonts API.

View the tutorial

Phing Build FileGeneral default build file for automating a PHP project

Screenshot of Jenkins

Jenkins, powered by my Phing build file

On my computer I have Jenkins installed for viewing analysis of code, and as I code with PHP and not Java, I use Phing instead of Ant as the build system. I run several PHP programs against the code I’ve written or auditing, and automate the creation of API documentation using DocBlox, as well as send that documentation via FTP to a docs subdomain.

I’ve refined my build file over time, but it has always been pretty much an identical file duplicated over many projects, and this wasn’t scaling well as I found the need to refine it further. Instead, I discovered the ImportTask in Phing, which meant I could have one generic build file kept outside of my project folders, and import that into each bare bones project build file and amend as necessary.

View the build file code