This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php
Nicolas Grekas 7a461cff0c minor #25867 [DI] Put non-shared service factories in closures (nicolas-grekas)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[DI] Put non-shared service factories in closures

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

With this change, non-shared services are moved to dedicated files (unless they are on the hot path).
Previously, they were always dumped as methods.

The goal of this change is to dump factories as methods *if and only if* the services they build are on the hot-path. By doing so, it will become very easy to figure out which services are on the hot path, vs the rest. And then people will be able to optimize their configurations: if too many things are dumped as  methods, it will trivially mean some laziness is missing in definitions.

I spotted this while reviewing the dumped container of Blackfire, where we sometimes have long chains of dependencies that are on the hot path for no real reason - mixed with big non-shared factories (Sonata admin blocks in our case.)

Commits
-------

22c5325 [DI] Put non-shared service factories in closures
2018-02-04 11:44:28 +01:00
..
php_with_wrong_ext.yml [DI] FileLoaders: Allow to explicit type to load 2017-01-10 12:54:54 +01:00
services1-1.php Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
services1.php Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
services8.php [DI] fix param name cast 2018-01-04 16:56:45 +01:00
services9_as_files.txt [DI] Put non-shared service factories in closures 2018-01-29 11:00:30 +01:00
services9_compiled.php [DI] fix param name cast 2018-01-04 16:56:45 +01:00
services10.php [DI] fix param name cast 2018-01-04 16:56:45 +01:00
services12.php [DI] fix param name cast 2018-01-04 16:56:45 +01:00
services13.php Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
services19.php Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
services24.php Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
services26.php [DI] fix param name cast 2018-01-04 16:56:45 +01:00
services33.php Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
services_almost_circular_private.php fixed some deprecation messages 2017-12-31 07:59:27 +01:00
services_almost_circular_public.php fixed some deprecation messages 2017-12-31 07:59:27 +01:00
services_array_params.php [DI] fix param name cast 2018-01-04 16:56:45 +01:00
services_base64_env.php [DI] fix param name cast 2018-01-04 16:56:45 +01:00
services_csv_env.php [DI] Add a simple CSV env var processor 2018-01-19 08:16:49 +01:00
services_env_in_id.php [DI] fix param name cast 2018-01-04 16:56:45 +01:00
services_inline_requires.php Merge branch '3.4' into 4.0 2018-01-29 10:06:29 +01:00
services_locator.php Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
services_private_frozen.php Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
services_private_in_expression.php Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
services_rot13_env.php [DI] fix param name cast 2018-01-04 16:56:45 +01:00
services_subscriber.php Merge branch '3.4' into 4.0 2018-01-04 16:52:56 +01:00
services_uninitialized_ref.php fixed some deprecation messages 2017-12-31 07:59:27 +01:00
simple.php moved component and bridge unit tests to the src/ directory 2012-03-29 08:37:22 +02:00