PHPNews

Formatting Exception Messages

Over the last couple years, I’ve started putting my Exception messages inside static methods on custom exception classes. This is hardly a new trick, Doctrine’s been doing it for the better part of a decade . Still, many folks are surprised by it, so this article explains the how and why. How does it work? Let’s …

Continue reading »

Written by Ross Tuck - - Aggregated on Tuesday October 27, 2015


How I Use Traits

Recently, a few folks asked about a trait in a new project I wrote. Right around the same time, Rafael Dohms showed me his new talk about complex cognitive processes we don’t notice. Because my brain is a big mushy sack, the two blended together. The result was this post, which tries to capture how I use traits but …

Continue reading »

Written by Ross Tuck - - Aggregated on Monday May 18, 2015


How I Use Traits

Recently, a few folks asked about a trait in a new project I wrote. Right around the same time, Rafael Dohms showed me his new talk about complex cognitive processes we don’t notice. Because my brain is a big mushy sack, the two blended together. The result was this post, which tries to capture how I use traits but …

Continue reading »

Written by Ross Tuck - - Aggregated on Monday May 18, 2015


Notes From 3 Conferences

I started this month by speaking or hosting at 4 events in 2 countries over 5 days ( DrupalCon Amsterdam , DomCode , ZgPHP , WebCamp ). While hectic, it was a great way to see a cross section of the community back-to-back. So, I’d like to talk about the events in turn but also some meta-topics about conferences …

Continue reading »

Written by Ross Tuck - - Aggregated on Sunday October 12, 2014


Notes From 3 Conferences

I started this month by speaking or hosting at 4 events in 2 countries over 5 days ( DrupalCon Amsterdam , DomCode , ZgPHP , WebCamp ). While hectic, it was a great way to see a cross section of the community back-to-back. So, I’d like to talk about the events in turn but also some meta-topics about conferences …

Continue reading »

Written by Ross Tuck - - Aggregated on Sunday October 12, 2014


Tips on Speaking

Earlier this evening, I was a guest on NoCapes , a new web series about sharing advice and encouraging folks to engage in the PHP community. It’s a great initiative, you should check it out. There’s also a video of my interview up as well. But as we begin The Autumn of a Thousand Conferences, I thought I’d follow …

Continue reading »

Written by Ross Tuck - - Aggregated on Friday September 12, 2014


Tips on Speaking

Earlier this evening, I was a guest on NoCapes , a new web series about sharing advice and encouraging folks to engage in the PHP community. It’s a great initiative, you should check it out. There’s also a video of my interview up as well. But as we begin The Autumn of a Thousand Conferences, I thought I’d follow …

Continue reading »

Written by Ross Tuck - - Aggregated on Friday September 12, 2014


Notes from LaraconEU

Having spent the previous weekend at LaraconEU, I wanted to jot my thoughts down about the conference, particularly some of the upcoming features unveiled by Taylor Otwell (the framework’s BDFL ). To clarify, I’ve never used Laravel, have no plans to do so right now and all of these features are still in active …

Continue reading »

Written by Ross Tuck - - Aggregated on Tuesday September 2, 2014


A Case for Event Sourcing in Browser JS Apps

Note: Everything in this blog post is purely theoretical, treat it as a thought experiment. I haven’t tried this yet. I’ve been thinking about use cases for Event Sourcing (ES). It’s most often associated with backend applications where you need strong audit logs but I’m starting to wonder if it might be a good fit …

Continue reading »

Written by Ross Tuck - - Aggregated on Tuesday July 22, 2014


Multistage environments with Ansible

Ansible has excellent documentation but one thing I was confused about was the best way to store the configuration for multistage projects: say, different passwords for dev, staging, production. This isn’t really covered in the ansible-examples repo because it’s specific to your project and while the documentation …

Continue reading »

Written by Ross Tuck - - Aggregated on Thursday May 15, 2014


(Slightly) Faster Ansible Testing with Vagrant

When writing Ansible playbooks, it’s useful to test them locally against your Vagrant box. The easiest way is just running “vagrant provision” after each change and then validating the results on the vagrant image. That said, this runs the entire playbook in full and while I enjoy a good cup of tea, there’s only so …

Continue reading »

Written by Ross Tuck - - Aggregated on Monday May 12, 2014


Domain Events on Creation

When not enjoying my funemployment , I’ve been talking to a lot of folks lately about domain events. One of the questions that’s come up multiple times is how to properly raise events when creating something. Say, a batch of noodles. I’m a simple man, so I reckon this is fine: class Noodles { use EventGene…

Continue reading »

Written by Ross Tuck - - Aggregated on Thursday March 20, 2014


Models & Service Layers Video Online

More so than any of my other talks, I’ve receive a huge number of requests for a video of “Models & Service Layers; Hemoglobin & Hogoblins”. At last, the original version from #phpnw13 is now online, many thanks to the awesome crew: This version is a bit older and doesn’t have some new content found in …

Continue reading »

Written by Ross Tuck - - Aggregated on Friday February 28, 2014


Persisting Value Objects in Doctrine

I’ve been using more and more Value Objects in my applications over the last year, primarily with Doctrine ORM. Value Objects are an extremely powerful technique and I’ve been impressed with how much they can clean up a codebase. One of the main questions I’ve had when starting with Value Objects is how to persist …

Continue reading »

Written by Ross Tuck - - Aggregated on Thursday February 27, 2014


ETags for the Uninitiated

In case you haven’t seen it, I’m writing a 3-part series about HTTP ETags on the Ibuildings blog. The first two parts have already been published and the third will be out early next year. The literature for using ETags in practice is a bit scattered so I hope this will help centralize it. Part 1: Intro to ETags …

Continue reading »

Written by Ross Tuck - - Aggregated on Sunday December 29, 2013


Raphael Roundup

Some recent converations prompted me to gather some of my recent Raphael related links in one place. For starters, my introductory article to Raphael “Pretty, Pretty Pictures” was published in this month's PHPArchitect . For a more in-depth look, NEPHP recorded my presentation on the …

Continue reading »

Written by Ross Tuck - - Aggregated on Thursday December 19, 2013


PHP 5.3 Closures and Reflection

Note This post is outdated (2009). Specifically, the Callable typehint and Closure typehints should be preferred to is_callable && is_object. You can also use $this inside anonymous functions from 5.4 as well. One of the things I’ve been really looking forward to in PHP 5.3 is seeing what I could do …

Continue reading »

Written by Ross Tuck - - Aggregated on Monday July 6, 2009