PHPNews

Avoiding Conditionals, an example

Written by blog - Published on blog
Aggregated on Monday August 14, 2017 - Permalink

Let's discuss an example I got from real code on how to avoid conditionals and end up having code that is actually easier to read.

Continue reading »


Commands, events, global functions and testing

Written by blog - Published on blog
Aggregated on Friday February 26, 2016 - Permalink

The other day I was listening to the FullStackRadio episode 34 which is about dealing with dependencies in Active Record models. This is a very interesting topic and they suggest a few solutions for it. I liked the suggestions and I tried to implement it differently. The result was really nice.

Continue reading »


PHP type hints: self and parent

Written by blog - Published on blog
Aggregated on Monday March 14, 2016 - Permalink

Less known type hints in PHP: self and parent. Why do we not use them as often? How long have they been around? Why and when are they useful?

Continue reading »


How to build faceted search with facet counters using Elasticsearch

Written by blog - Published on blog
Aggregated on Friday March 25, 2016 - Permalink

We all know them, search pages which allow you to filter through vast data sets by checking or unchecking filters. In most cases each filter is followed by a counter which indicates how many results will be shown when you apply that filter. Those counters inform the user about their next move before they perform it.

Continue reading »


Concurrent HTTP requests without opening too many connections

Written by blog - Published on blog
Aggregated on Friday April 15, 2016 - Permalink

What happens if you need to perform a large number of concurrent requests? If you don't control the number of request you might end up with a dangerously large amount of open TCP sockets to a server. Let's see how to protect ourselves from that.

Continue reading »


Introduction to domain driven design

Written by blog - Published on blog
Aggregated on Monday July 11, 2016 - Permalink

As applications grow bigger and bigger, our codebase needs to accommodate for more and more business actions. After a while you will have code that impacts a large amount of business actions without knowing exactly what they are. Changes to that code become more and more stressful. We had long been feeling the need to handle this complexity of our applications in a more explicit and clearer way.

Continue reading »