Project

General

Profile

Actions

Task #91237

closed

Symfony DI (dependency injection) for ClassAliasMap(s)

Added by Christian Hackl over 4 years ago. Updated about 2 months ago.

Status:
Rejected
Priority:
Should have
Category:
System/Bootstrap/Configuration
Target version:
Start date:
2020-04-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Symfony DI (dependency injection) for ClassAliasMap(s)

For example dependency injection for "\TYPO3\CMS\Frontend\Page\PageRepository" via constructor didn't work.

// Classes/Controller/MyController.php

/**
 * pagesRepository
 *
 * @var \TYPO3\CMS\Frontend\Page\PageRepository
 */
protected $pageRepository = null;

public function __construct(\TYPO3\CMS\Frontend\Page\PageRepository $pageRepository) {
    $this->pageRepository = $pageRepository;
}
Actions #1

Updated by Benjamin Franzke over 4 years ago

  • Assignee set to Benjamin Franzke
Actions #2

Updated by Benjamin Franzke over 4 years ago

For reference, initial discussion was here: https://typo3.slack.com/archives/C0CRS7RFH/p1588169890380700

Actions #3

Updated by Benni Mack over 4 years ago

  • Target version set to next-patchlevel
Actions #4

Updated by Garvin Hicking 4 months ago

  • Category set to System/Bootstrap/Configuration
Actions #5

Updated by Garvin Hicking 2 months ago

  • Status changed from New to Needs Feedback

Is this something that still needs addressing, or can we close it?

Actions #6

Updated by Benjamin Franzke about 2 months ago

  • Status changed from Needs Feedback to Rejected

There is no "proper" way to solve this generally, sorry.
We need to add define (deprecated) service aliases when moving public API in new cases like these.

An example for that is the following change:

75994: [BUGFIX] Add alias for moved RecordLinkHandler service | https://review.typo3.org/c/Packages/TYPO3.CMS/+/75994

That means this is sth. we need to generally take care of in reviews.

Actions

Also available in: Atom PDF