Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document DI Autoconfigure attribute for public/shared = true as alternative to Services.yaml #4539

Open
brotkrueml opened this issue Jun 13, 2024 · 0 comments

Comments

@brotkrueml
Copy link
Contributor

TYPO3 supports the Autoconfigure attribute for declaring a class as public/shared, for example:

use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;

#[Autoconfigure(public: true)]
class MyClass {
    // ...
}

This should be documented in the DI chapter where "public" is explained as alternative to declaring in Services.[yaml|php].

See also: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84676

This works also in TYPO3 v12 with at least Symfony 7 (I assume also Symfony 6, but has to be tested). The attribute itself was introduced with Symfony 5.3, so this may also work in TYPO3 v11.

@brotkrueml brotkrueml changed the title Document DI Autodonfigure attribute for public/shared = true as alternative to Services.yaml Document DI Autoconfigure attribute for public/shared = true as alternative to Services.yaml Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant