Logan Bailey

Adventures In Web Development

Blog, About, GitHub, and LinkedIn

Auto Dependency Resolution for IOC

September 11th, 2014
Ever wondered how Laravel determines which objects to pass into your classes. This guide explains how automatic dependency resolution works by showing you how to make a basic IoC container. This relies heavily on php reflection api.

Horizontal Code Reuse Through Traits

February 22nd, 2014
Traits were added to php in version 5.4 as a way to introduce horizontal code reuse. They end up being a way to programmatically copy and paste methods into objects. Traits act as php's version of multiple inheritance.

Cleaning up your templates with array_chunk

January 23rd, 2014
array_chunk is a native php method you've probably never used before, but it probably could have saved you time on lots of occasions. Here we'll dive into a use case for array_chunk, other than batch requests to services, that will help you write cleaner code.

Opening VIM From Inside PHP

September 1st, 2010
Want to prompt the user for a large amount of text for your CLI application? Using some flag and a large string on the command line is not always ideal. Fear not, it's easy to open a text editor from inside your application.