Archive for the ‘Design Patterns’ Category

What Is Snapshot Testing, and Is It Viable in PHP?

Posted on: No Comments
Ah-ha moments are beautiful and rare in programming. Every so often, we're fortunate enough to discover some trick or facet of a system that forever changes how we think of it. For me, that's what snapshot testing is. You probably write a lot of PHP c...

Designing The Perfect Accordion

Posted on: No Comments
    Design patterns. An almost mythical phrase that often inspires either awe or resentment. As designers, we tend to think of design patterns as generic off...

The Balance between Visual and Technical Debt in PHP

Laracasts recently published a very interesting non-Laravel video about something called visual debt. It's only 3 minutes long, so please, take the time to watch it before reading further. Done? Okay, spoilers below. In the video, Jeff starts out wit...

Re-Introducing Composer – the Cornerstone of Modern PHP Apps

Posted on: No Comments
In this article, we will tackle the basics of Composer, and what makes it such a powerful and useful tool. Before we go into detail, there are two things that we need to have in mind: What Composer is: As we can see on their website: "Composer is a t...

Upgrading Sylius the TDD Way: Exploring Behat

Posted on: No Comments
Last time, we developed some new features on top of Sylius' core to indicate which products and their variants are low on stock and need replenishing. Now, we move on to seeing our changes in the UI, which means we will need to do a bit of StoryBDD tes...

Upgrading Sylius the TDD Way: Exploring PhpSpec

The post on developing and testing new Sylius features was an introduction to the three types of tests that are used in Sylius - PHPUnit, Phpspec and Behat. In this part, we'll extend some core classes to indicate color-coded inventory status. First, w...

Functional Programming with Phunkie: Funky Parser Combinators

Posted on: No Comments
Phunkie is a library with functional structures for PHP. In this tutorial, Phunkie creator Marcello Duarte, head of training at Inviqa, explains how to create Parser combinators using the functional library. This post first appeared on the Inviqa blog,...

Upgrading from PThreads v2 to V3: What to Look out For

Posted on: No Comments
A fair amount has changed for the pthreads extension with the release of pthreads v3. This article aims to cover the necessary information for those who are looking to upgrade their applications from pthreads v2 to v3. If you're unfamiliar with pthread...

Creating Strictly Typed Arrays and Collections in PHP

Posted on: No Comments
One of the language features announced back in PHP 5.6 was the addition of the ... token to denote that a function or method accepts a variable length of arguments. Something I rarely see mentioned is that it’s possible to combine this feature with t...

My Laravel Package Building Workflow

Posted on: No Comments
Packages are a really important part of the Laravel experience (just like with any other framework). Whatever we need to do, there’s probably already a package for it out there; ready for a composer require to bring some magic in. Some weeks ago,...