Project

General

Profile

Actions

Task #102008

closed

Interface Alias is shared by default

Added by Timo Borer about 1 year ago. Updated about 1 year ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2023-09-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Sprint Focus:

Description

Normally, a Service is only shared when it extends the `SingletonInterface` or set directly.

This Service below acts as a singleton, but is not expected to be one as it doesn't extend the `SingletonInterface`.

My\Extension\Domain\Interface\MyServiceInterface:
  alias: My\Extension\Service\MyService
  public: true

To achieve it you need to add the following:

My\Extension\Service\MyService:
  shared: false

Wouldn't it make more sense to also make the service shared: false if it is aliased and only shared if it uses the SingletonInterface?

Actions

Also available in: Atom PDF