A
A
ArrayPop2021-07-19 16:00:51
symfony
ArrayPop, 2021-07-19 16:00:51

What does the first hint in symfony container using factory mean?

I can't understand the meaning of these words

When using a factory to create services, the value chosen for class has no effect on the resulting service. The actual class name only depends on the object that is returned by the factory. However, the configured class name may be used by compiler passes and therefore should be set to a sensible value.

In Russian:
When using a factory to create services, the value chosen for the class has no effect on the resulting service. The real class name depends only on the object returned by the factory. However, the configured class name may be used by compiler omissions, and therefore must be set to reasonable values.

Links to the Russian and English versions of the documentation:
https://symfony.ru/doc/current/service_container/f...
https://symfony.com/doc/current/service_container/...
I would like to know how it works in practice check, because the meaning of this information is generally not clear to me, and how to check it in the project.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Gordinskiy, 2021-07-20
@DmitriyGordinskiy

We are talking about the class field, which can still be specified when describing the service, which will still be parsed as part of the config, so it must be valid, but which will not affect the class that this service will be in any way, since it will depend already from the result of the factory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question