PHP, the Friendly Server-Side Code

There are plenty of server-side languages to build website out of these days, but none as prevalent or as familiar as PHP. With its loose types, random standards, and base in procedural code, it may be easy to write applications sloppy but that much more interesting and challenging to write them elegantly. Which is what Jacob strives to do everyday.

A Year of Commits and Pushes

Over a year ago I made the decision to publish the custom framework behind my personal website. There were a few reasons why I wanted to share the code, though the main driver was that I wanted to actively modernize my code base. And it worked. Since pushing my custom framework I've updated huge…

  • Category Web Development
  • Posted December 8, 2016
  • read more

A Middleware for Swagger Resolution

A few months ago I started building a Swagger resolver library, with the intention of having a parser that understood different inheritance properties of the spec. About halfway through I realized that this library was going to be huge, with dozens of objects, and that it wasn't going to work the…

  • Category Web Development
  • Posted November 29, 2016
  • read more

Using peel for HTTP Exceptions

Middleware is a powerful concept that modern frameworks use to bridge between separate parts of a stack - namely, a HTTP layer and application. A request comes in, is validated/manipulated by middleware, triggers behavior in the application, and then the response goes back out through the same…

  • Category Web Development
  • Posted November 15, 2016
  • read more

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

Mocking Internal PHP Functions

A problem that I've run into during the unending quest for complete test coverage is mocking of internal PHP functions. Unit tests are easy to write as long as a class method returns everything it does, but when a method starts to call out to certain internal PHP functions things get difficult. It's…

  • Category Web Development
  • Posted May 31, 2016
  • read more

JSON Responses in Guzzle 6

Guzzle is a wildly popular PHP client that makes it simple to perform HTTP requests. The latest version, Guzzle v6, implements PSR-7 standards when handling requests and responses. By enforcing this standard HTTP messaging protocol it is now easier to have inter operable exchanges between packages,…

  • Category Web Development
  • Posted January 14, 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

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…