PHPnews.io

@inject or @required will Get You Any Services Fast

Written by Tomáš Votruba / Original link on Jun. 1, 2020

It is official. Symfony 5.1 [adds property injection to public properties](https://symfony.com/blog/new-in-symfony-5-1-autowire-public-typed-properties). Now, `@inject` or `@required` annotation above property or setter method is the fastest way to get any dependency on any service in your Symfony or Nette project. Use it everywhere you can... or not?

tomasvotruba

« How to Sell WordPress to Anyone? - I don’t think I can afford that »