Tobias Nyholm

Tobias Nyholm

Developer

Tobias Nyholm is a developer. He is the author of this blog.

Articles

Symfony

Symfony setter injection

The Symfony documentation explains four ways to inject dependencies to your service. In short, you can use the constructor, inject directly to a public property or you can use a two flavours of inject...

Tobias Nyholm
Symfony · Runtime · Bref

Performance test: Bref FPM vs Bref + Runtime component

The Symfony Runtime component is AWESOME. I did a talk about it at Symfony World 2021 where I explain how and why it works. I spent a lot of time on the content and the recording, one can still watch ...

Tobias Nyholm
Symfony · Messenger · Lock

Symfony Lock and Messenger component

The lock component have saved me so many times. It helps me with race conditions, it makes my code simpler and my application more reliable. I'm using it to fix all kinds of problems and I've noticed ...

Tobias Nyholm

One year of AsyncAws

It has been one year since Jérémy Derussé and I started to work on a new API client for AWS. At the time we could never have imagined how popular it would be. In this first year we had over 1.5 millio...

Tobias Nyholm
Symfony · Messenger

Finding the correct values for Symfony Messenger failure strategy

Symfony Messenger is great. It has so many features and is super flexible. I want to highlight one of these features in this small post: Failures and retries. Over in the Symfony docs failures and ret...

Tobias Nyholm
PHP · Blackfire

Installing Blackfire on multiple servers

We have a lot of applications running on both EC2 machines and a lot of Lambda functions. Most of them are small microservice applications that are rarely updated with new features. We've installed an...

Tobias Nyholm
PHP · Symfony

PHP 7.4 preloading benchmark

Preloading arrived to PHP 7.4.0 in November 2019. I was super excited about this and I started to try it out. But I quickly noticed that it was a little buggy when you started with a "real world&...

Tobias Nyholm
Serverless · Performance

Optimize images on S3 with AWS Lambda and Serverless

An image is uploaded on S3, that triggers a lambda that optimize that image and put it back. How hard can that be? It was way more tricky than I thought, especially since Im not used to the Node ecosy...

Tobias Nyholm
Symfony

Symfony HTTP Client and caching

Symfony has a HTTP client which differ from other clients like Guzzle, Buzz or clients from the HTTPlug organization. Symfony's HTTP client is asynchronous by default. Using asynchronous anything is s...

Tobias Nyholm
Bref · Messenger · Symfony

Symfony Messenger on AWS Lambda

For the past 4 years we have developed web applications with a message bus. The Symfony Messenger component was released around a year ago and I've loved it since. In the past few weeks we've been dep...

Tobias Nyholm
Bref

Using NewRelic with Bref on AWS Lambda

Running serverless is great. When migrating our applications to use Bref we realized that we need a non-standard php-extension. With "non-standard" I mean that the extension is not included ...

Tobias Nyholm
Web

Blocking vs non-blocking fonts

Just the other day I found out about the font-display: swap; css directive. It basically allows you to configure the browser to load the webpage first and then add the correct fonts when they are load...

Tobias Nyholm
Symfony

Symfony State Machines and Domain Driven Design

It has been just over 2 years since Symfony released their Workflow component. I was of course thrilled by the news and started to work on multiple PRs to make the component support state machines. It...

Tobias Nyholm
Symfony

Define Symfony access control rules in a database

I was recently at a PHP conference in Odessa where I met many great developers. One of them asked me a question, that the answer was not obvious. His use case was that he wanted to use Symfonys Access...

Tobias Nyholm
Symfony

Testing the Symfony 4.1 router

How much faster is the new Symfony router in a real world application? We ran some tests to find out. An improved router A few days ago we received the fantastic news that the Symfony router had been ...

Tobias Nyholm
Symfony

Generate URLs in Symfony commands

It has been great many years since Symfony 2.0 was released. 2.0 did not have as many great features as Symfony 4.0, but it was flexible and you could still accomplish what ever you want. I've just fo...

Tobias Nyholm

Always use caret instead of tilde

I've been noticing people having trouble understanding the differences between the caret ("^") and the tilde ("~") operator in the composer.json file. Composer's documentation is g...

Tobias Nyholm
Developing · Symfony

Open files in PHPStorm from you Symfony application

If you want to open files in PHPStorm8 directly from the Symfony debug toolbar there is a neat trick you can use. This is very helpful when you quickly want to find a controller or when you got an exc...

Tobias Nyholm
Symfony · Performance · Doctrine

Choose owning side in OneToOne relation

Many times I've come got to a situation where I have a unusual high query count. When I inspect the queries in the Symfony profiler I can see that Doctrine is fetching objects I have not requested. To...

Tobias Nyholm