If you've ever implemented an HTTP API in PHP, you probably know that there's one thing you have to do over and over and over: parse the request body and validate the resulting structure. Now that we have PSR-15, let's use a middleware for that!
They say you should understand floating-point precision by 35.0000000000014. This post is here to help you: it discusses how floats are (im)precise and why, demonstrates the problems you inevitably encounter when doing math with floats, and presents ways to prevent those problems by using more proper data types and structures.
There's a new buzzword on the PHP block: frameworkless. The activities of PHP communities last year made it possible to build robust applications, uniquely composed of little bits, without relying on a big framework. Let's find out how they work and if it's a good approach.
As the business requirements grow, so does the list of dependencies. Managers ask for a new feature, you just composer-require this thing and that other thing, and wire it into the application. But how do you keep track of new features in the dependencies? Or bugfixes? Or, most importantly, security patches?!
In the course of the last few weeks, I have invested some time into Naja. You might recall my previous announcement in which I stated that there was still one big thing left to do. Well, now it is done!
Almost six months ago, I have released an alpha version of a new, modern AJAX library for Nette Framework named Naja. Now, after half a year in the wild production environment, I guess the time has come for a stable version.
Almost every application needs to work with time: if not for some greater purpose like expiring access credentials, entities usually store information about when they were created or generally when something happened. Telling time is indeed a crucial responsibility, and being able to rely on the mechanism across the whole codebase is really important. But it can get problematic.
A few minutes ago, I have released a total rework of my intellij-nette-tester plugin that integrates Nette Tester into PhpStorm.
I've had a really productive couple of weeks and (mostly) weekends recently. I've worked extensively on one of my side projects using modern JS stack including Webpack, faced issues here and there, and found a way to solve them. In the end, I proudly announce three new open-source packages: a modern AJAX library for Nette Framework, Neon loader for Webpack, and a library integrating the Webpack build process into Nette-powered applications.