Argument 2 passed to Symfony\Component\HttpKernel\Event\FilterControllerEvent::__construct() must be callable

The following error occured to me in a custom controller:

TypeError: Argument 2 passed to Symfony\Component\HttpKernel\Event\FilterControllerEvent::__construct() must be callable, object given, called in /var/www/html/vendor/symfony/http-kernel/HttpKernel.php on line 145 in Symfony\Component\HttpKernel\Event\FilterControllerEvent->__construct() (line 24 of /var/www/html/vendor/symfony/http-kernel/Event/FilterControllerEvent.php).

Render arrays are great for styling elements to keep consistency across future updates. Today: buttons.
EntityForms are gaining importance in drupal 8 and 9. This is how to make sure you are in one.
Revisions are a great thing for tracking changes between entities. This snippets allows you to name them different in your entity forms.

Controller\ ::__construct(), 0 passed in /var/www/html/web/core/lib/Drupal/Core/Controller/ControllerBase.php on line 109

This error occurs when trying to user services in your constructor in drupal. If you want to do something like this, you'd have to make sure your container is right. 

Check out this code, make sure you use the create() method to instantiate the container object.

https://chromatichq.com/blog/dependency-injection-drupal-8-plugins

 

An often use case for dashboards or software behind a login is to redirect anonymous users to the login page. Like always, I do not want to use contributed modules for this.
This technique is used quite a lot to get an image styled url of an image in your twig file.