PHP Traits are a great tool for code reuse. They allow developers to write methods that can be used in any number of classes, keeping your code DRY and more maintainable. Define a PHP Trait Traits are defined much in the same way as classes.
public function speak(string $output)
You’ll notice that we’re declaring a
trait rather than…
In part 4 we laid the foundation for Analyze. Now it’s time to write the very first lines of code! Before we continue, please allow me to interrupt with a quick announcement: I’ve started a newsletter! Each week I’ll send you a great email filled with updates, great links, tips & tricks, and other non-dev…
For the past several months I’ve been studying a philosophy known as Stoicism. I became interested in the subject after reading Meditations by Marcus Aurelius. I took a handful of philosophy courses in college and I’ve always enjoyed the subject, but Stoicism is different. I’m by-no-means an expert – I’m not an expert at anything –…
Part 3 was all about action – without actually taking any or writing any code. This installment will actually see the groundwork for the Analyze framework taking shape. Framework Structure Most frameworks I have experience with or have researched take approach of having a main “core” framework along with an example app. Some examples include…
In part 2 of this series I discussed what web frameworks are and, in (very) broad terms, how they worked. Now it’s time to take the first step toward actually building a framework. Architectural Pattern or Design Pattern? Near the end of the last installment I mentioned that I had decided to use an architectural…