Viewing posts about Oop.

Swagger Inheritance

Swagger spec is an awesome tool for describing APIs in a standardized way, allowing programs to understand and interpret them. It is a set of files (often just one) written in JSON or yaml that defines the routes, parameters, responses, and metadata of an API. After a spec has been written it can be…

  • Category Web Development
  • Posted September 12, 2016
  • read more

Using Mocks with PHPUnit

Creating test doubles, or mocks, is a feature of PHPUnit that I recently discovered and am quickly falling in love with. Previously I would find other ways to mock my system, like creating SQLite connections instead of a persistent database, or even duplicating an entire mock class for injection.…

  • Category Web Development
  • Posted August 25, 2016
  • read more

Using Domain Repositories for Services

Last year I started building out domain repositories in order to encapsulate the data retrieval for my website. They were easy to build, straightforward to implement, and simple to test. At the time all of the data retrieval was through a standard sql database, so all I had to do was pass in a…

  • Category Web Development
  • Posted July 22, 2016
  • read more

Refactoring Particletree's PHPQuickProfiler

Back in 2009 I was working at a company in De Pere called SparkNET. I was still a fresh developer then, just getting used to working with a team and building on modern web framework principles. One of the tools that they introduced was a profiler from Particletree that kept track of simple…

  • Category Web Development
  • Posted December 24, 2015
  • read more

Unit Testing Data Repositories

Unit testing is something that I'm still rough around the edges with. I don't do it nearly enough at work and never really pushed myself to pick it up on the side. With my core site refactor, though, it seemed like a good time to wander into testing. And it made a lot of sense to write unit tests…

  • Category Web Development
  • Posted December 16, 2015
  • read more

Playing with PHP Closures

In my previous post about anonymous functions I mentioned that PHP 5.3 brought in some sweet semantic improvements. Namely, the release introduced the __invoke method and Closure class. Everytime you create a new anonymous function you are actually creating an instance of Closure, and when you…

  • Category Web Development
  • Posted April 20, 2015
  • read more

Anonymous Functions in PHP

Anonymous functions have enjoyed a long history with PHP. Well, some version of anonymous functions. PHP 4, released in the long-ago of 2000, had several functions that required the passing in of callbacks, including usort, array_map, and array_walk. To use these you could pass in a callable by name…

  • Category Web Development
  • Posted April 17, 2015
  • read more

Midwest PHP Conference 2013

I haven't been too many conferences. DealerFire only pushed vendor conferences, fancy get-togethers in cities like Miami and Las Vegas where we all rubbed elbows with industry leaders and vied for customer attention. When I found out that Blue Door Consulting, my current place of employment, wanted…

  • Category Web Development
  • Posted March 8, 2013
  • read more

Spaghetti Code vs Lasagna Code

In an effort to streamline and homogenize code a number of design patterns and best practices have sprung up in the programming field. One of the ideas that has moved across programming disciplines is the vilification of long strands of meandering logic, or called spaghetti code. For many in the…

  • Category Web Development
  • Posted November 9, 2012
  • read more

How I Learned to Stop Worrying and Love the String Object

PHP was the first programming language that I understood fluently. Sure, I had dabbled in BASIC, Java, ActionScript (3.0 is pretty awesome), and a few others, but PHP was the first language that I felt truly comfortable with. It wasn't until I moved onto JavaScript that I started to understand a…

  • Category Web Development
  • Posted September 24, 2012
  • read more

Activity Stream

  • Read 'Salem's Lot by Stephen King.
  • Read Elantris (Elantris, #1) by Brandon Sanderson.
  • Read It by Stephen King.
  • Read Mistborn Trilogy (Mistborn, #1-3) by Brandon Sanderson.
  • Read Tress of the Emerald Sea by Brandon Sanderson.
View more activities…