mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-10-22 21:16:14 +02:00
Daniel Siepmann
b8ef4383b7
* Migrate existing configuration from yaml to php. * Document why we did the switch and that using yaml or both is totally valid and conforms to best practices. * Document why we are not using attributes but only `Services.php` right now. Resolves: #1172 Relates: #1237
28 lines
963 B
ReStructuredText
28 lines
963 B
ReStructuredText
.. include:: /Includes.rst.txt
|
|
|
|
.. _servicesFiles:
|
|
|
|
Services Files
|
|
==============
|
|
|
|
We choose to use :file:`Services.php` instead of :file:`Services.yaml`.
|
|
It still is completely fine to use YAML files over PHP files or even mix both.
|
|
Some things are way shorter to write with the YAML syntax.
|
|
|
|
We prefer the PHP file over YAML for the following reasons:
|
|
|
|
- Static Code Analysis
|
|
|
|
Static code analysis tools, like PHPStan, can analyse the PHP source code base.
|
|
They typically don't support other files like YAML.
|
|
Those tools report issues for not found classes, e.g. due to typos.
|
|
|
|
- Auto completion
|
|
|
|
Modern tooling like IDEs and Language Servers provide auto completion for PHP source files out of the box.
|
|
That way programmers can discover APIs and write more robust code faster.
|
|
|
|
- Automatic code migration
|
|
|
|
PHP Code can be auto migrated via tools like rector.
|
|
E.g. renaming a class can be applied to PHP code, but no current tool for yaml exists.
|