Migrate TYPO3 Extbase task to Symphony command

  extbase, symfony, typo3, typo3-10.x

I’m trying to migrate the extension pb_social to TYPO3 10 LTS but I’m stuck in the migration of the scheduler task that updates TYPO3 data from the social feeds.

I learned how to register a Symfony Console Command with the Services.yaml file so I can execute the command.

The problem is that the pb_social extension relies on Extbase same as its actual updateFeedDataCommand command.

So I tried to create a new command in the Symfony style and in its method execute() I instantiated:

$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var PBSocialCommandController $controller */
$controller = $objectManager->get(PBSocialCommandController::class);

I already updated the properties of pb_social methods to use the new @TYPO3CMSExtbaseAnnotationInject but still the injections seems not to work.

E.g. with:

* @var TYPO3CMSExtbaseConfigurationConfigurationManagerInterface
* @TYPO3CMSExtbaseAnnotationInject
protected $configurationManager;

$this->configurationManager is null when used.

What could be the problem?

Source: Symfony Questions