I decided to extract some core classes I’ve used in several of my projects into their own package, a data-manager. DataManager is a container that does exactly what it says: manages item data for things like configuration settings. It also handles dot notation and exceptions. It should:

  1. Be stupid simple and lean — no extra features or code
  2. Create, Retrieve, Update, Delete and confirm/deny single items or complex items (array)
  3. Allow for fallback values if get() no item
  4. Handle deeply nested items through dot-notation (this.one.here)
  5. Be super extendable super easily

I worked for a few hours and cranked out exactly what I needed using Test Driven Development. You can use the Manager freely from github or composer. But, I wanted to share my process. This series will lead you through, step-by-step, the entire creation workflow for a php composer package using Test Driven Development. This is great for beginners who want to see TDD in practice.

You can see the finished version of this tutorial at chrismichaels84/data-manager/tree/tutorial-part-3 or use the finished, feature-complete, supported DataManager at chrismichaels84/data-manager.

Series Contents

  1. Setting Up – Define our goals and get our skeleton in place
  2. Features and Contracts – Define our API and get some core functionality
  3. Dot Notation – Dig deep into array structures (one.two.three)
Follow me

Chris Michaels

Storyteller. Researcher. Coder. Innovator. I seek to push the boundaries of storytelling and education.
Follow me

Latest posts by Chris Michaels (see all)