Rework how nested definitions are handled (fix #501 & #487) #540
Sorry for the big PR if you intend to review, the work behind that kinda grow organically from a small change :) Reworking those commits would be very complicated.
This PR solves the problem of nested definitions, i.e.:
The main change is this PR is very structural:
(to normalize definitions they are now like "tree nodes", i.e. the normalizer visits each definition and its subdefinitions to prepare it for the resolver)
That means a bit more job in definition sources, less in resolvers and compiler. The code is simpler and handles all edge cases the same way \o/
Definitions are now completely prepared by the definition source thanks to the normalizer.
Use the definition class directly to simplify and optimize everything.
# Conflicts: # src/Definition/Definition.php # src/Definition/HasSubDefinition.php # src/Definition/ObjectDefinition/PropertyInjection.php # tests/UnitTest/Definition/ArrayDefinitionExtensionTest.php # tests/UnitTest/Definition/DecoratorDefinitionTest.php # tests/UnitTest/Definition/Helper/ArrayDefinitionExtensionHelperTest.php # tests/UnitTest/FunctionsTest.php