Posts by "Benjamin Grandfond"

Don’t overuse dependency injection

The other day, I stumbled upon the following code that I wrote a few days before. <?php // src/Foo/BarBundle/Manager/ReportManager.php namespace Foo\BarBundle\Manager; use Symfony\Component\Security\Core\SecurityContextInterface; use Symfony\Component\Finder\Finder; class ReportManager { /** * @var \Symfony\Component\Security\Core\SecurityContextInterface */ protected $securityContext; /** * @var String */ protected $baseDir; /** * @param string $directory * @param \Symfony\Component\Security\Core\SecurityContextInterface $context */ public function __construct($directory,… Continue reading