PHPnews.io

Overview for 'stitcher-io'

PHP reimagined

Written by Stitcher.io / Original link on Mar. 20, 2020

This post is simply me thinking about how we could change PHP to make it better.It's a very subjective list, and in no way a critique on the amazing work the core team is doing.# Final by defaultA common misconception about OO programming is that it's all about inheritance.Inheritance and polymorph…


Event driven server in PHP

Written by Stitcher.io / Original link on Mar. 13, 2020

Lately I've been tinkering with a unique kind of architecture for PHP applications. I want to tell you up front that I don't think it will solve any real-life problems soon; still I want to involve you in the thought-process. Who knows what kind of great ideas might arise?In this post I'll go throu…


Bitwise booleans in PHP

Written by Stitcher.io / Original link on Feb. 14, 2020

In my previous post I wrote about applying enum patterns in PHP, without native enum support.In that post, I gave the example of a "date range boundaries" enum, one that represents which boundaries are included in the range, and which are not. It had four possible values:Boundaries::INCLUDE_NONE();…


Enums without enums in PHP

Written by Stitcher.io / Original link on Feb. 1, 2020

Enums are still lacking in PHP, yet there is a clean way to have enum-like behaviour in your code bases, without using external dependencies. Take the example of date range boundaries: its boundaries can be included or excluded. Here's how a Boundaries enum would be used:$dateRange = DateRange::ma…


09. Test factories

Written by Stitcher.io / Original link on Jan. 29, 2020

Note: this chapter mostly addresses domain-related code. We'll come back to the application layer in future chapters.In this chapter of Laravel beyond CRUD, we're going to look at how we can manage domain data for tests. Test factories in Laravel are a known concept, though they lack in many areas: …


PHP in 2020

Written by Stitcher.io / Original link on Jan. 17, 2020

It's no secret among web developers and programmers in general: PHP doesn't have the best reputation. Despite still being one of the most used languages to build web applications; over the years PHP has managed to get itself a reputation of messy codebases, inexperienced developers, insecure code, …