Hannes Van De Vreken

Hannes Van De Vreken

12 posts
Concurrent HTTP requests without opening too many connections

Concurrent HTTP requests without opening too many connections

I’ve been performing a talk on PSR-7 at PHP meetups and conferences. In that talk I demo the use of Guzzle to perform concurrent HTTP requests. Now what happens if you need to perform a large number of concurrent requests? If you don’t control the number of requests...

*AwareInterfaces: simple interfaces with getter and setter

*AwareInterfaces: simple interfaces with getter and setter

Sometimes you see simple interfaces with a getter and a setter for a specific type of object. Some examples are league/event‘s EmitterAwareInterface and league/container‘s ImmutableContainerAwareInterface. Also Zend Framework 2 has a ton of *AwareInterfaces like (but not limited to) these: These packages often come with a...

Why You Should Avoid Over-Abstracting

Why You Should Avoid Over-Abstracting

Some time ago I started working on an existing project, so I read the documentation before diving in. At the top of the contributing.md file there was this sentence: “Abstract when possible”. Quickly I learned the project contained more abstract classes than a normal project. This leads to too...

PHP Docblock return types

PHP Docblock return types

Return type hinting is great! When I use my IDE and experiment with classes that I haven’t used before, I really love that it tells me what kind of object a method returns to me. My IDE doesn’t use Artificial Intelligence to know that, it reads the PHP...

HTTP Client for SDKs

HTTP Client for SDKs

SDKs I like using SDKs when I’m creating prototypes. It’s super easy to get started. You copy and paste some code samples, fill in the minimal configuration needed and there you have it: your first response from the service you’re checking out. In a world where most...

Displaying stream progress in PHP

Displaying stream progress in PHP

With PHP you can, next to handling HTTP requests, invoke scripts from the command line. For a typical web application this could be used to run database migrations, insert data into the database from fixtures or seeders, repetitive tasks run by cron, clear the cache (cache:clear), general admin stuff…...

Code Style options for Cleaner Diffs

Code Style options for Cleaner Diffs

Our previous blog post covered tips on code style fixing while working on legacy projects. The blog post was very generic and the ideas are applicable to projects in any language. I mentioned some tips that help your peer developers review your pull requests. What I didn’t mention are...

Improving code style when working on a legacy code base

Improving code style when working on a legacy code base

Legacy projects Old projects (maybe even 6 months or less) often come without test suites, are tightly coupled with an outdated version of a framework (if not: has lots of boilerplate code), and are written without consistency in code style. When working on such a project, it’s tempting to...

Tilde and caret version constraints in Composer

Tilde and caret version constraints in Composer

When installing a dependency, we are used to installing a version that adheres to a known public interface and does what it promises. That way we can safely use it in our code. A dependency that uses semantic versioning allows you to predict whether it is still going to work...

You’ve successfully subscribed to madewithlove
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Success! Your email is updated.
Your link has expired
Success! Check your email for magic link to sign-in.