public function beforeCompile() { foreach ($this->getContainerBuilder()->getDefinitions() as $def) { if ($def->getTag(self::TAG_INJECT) && $def->getClass()) { $this->updateDefinition($def); } } }