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
Ryan Weaver a943b96d42 Not allowing autoconfigure, instanceofConditionals or defaults for ChildDefinition
Also, not allowing arguments or method calls for autoconfigure. This is a safety
mechanism, since we don't have merging logic. It will allow us to add this in the
future if we want to.

The reason is that parent-child definitions are a different mechanism for "inheritance"
than instanceofConditionas and defaults... creating some edge cases when trying to
figure out which settings "win". For example:

Suppose a child and parent definitions are defined in different YAML files. The
child receives public: false from its _defaults, and the parent receives public: true
from its _defaults. Should the final child definition be public: true (so the parent
overrides the child, even though it only came from _defaults) or public: false (where
the child wins... even though it was only set from its _defaults). Or, if the parent
is explicitly set to public: true, should that override the public: false of the
child (which it got from its _defaults)? On one hand, the parent is being explicitly
set. On the other hand, the child is explicitly in a file settings _defaults public
to false. There's no correct answer.

There are also problems with instanceof. The importance goes:
  defaults < instanceof < service definition

But how does parent-child relationships fit into that? If a child has public: false
from an _instanceof, but the parent explicitly sets public: true, which wins? Should
we assume the parent definition wins because it's explicitly set? Or would the
_instanceof win, because that's being explicitly applied to the child definition's
class by an _instanceof that lives in the same file as that class (whereas the parent
definition may live in a different file).

Because of this, @nicolas-grekas and I (we also talked a bit to Fabien) decided that
the complexity was growing too much. The solution is to not allow any of these
new feature to be used by ChildDefinition objects. In other words, when you want some
sort of "inheritance" for your service, you should *either* giving your service a
parent *or* using defaults and instanceof. And instead of silently not applying
defaults and instanceof to child definitions, I think it's better to scream that it's
not supported.
2017-04-28 17:09:21 -04:00
..
Asset Merge branch '3.2' 2017-04-26 10:23:43 -04:00
BrowserKit Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Cache [Cache] Keep only hit/miss (not values) in TraceableAdapter/Cache 2017-04-19 11:39:36 +02:00
ClassLoader Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Config Merge branch '3.2' 2017-04-12 22:43:31 +02:00
Console Merge branch '3.2' 2017-04-25 21:46:15 -04:00
CssSelector Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Debug feature #21502 Persist app bootstrapping logs for logger datacollector (ScullWM, nicolas-grekas) 2017-04-20 11:12:40 -06:00
DependencyInjection Not allowing autoconfigure, instanceofConditionals or defaults for ChildDefinition 2017-04-28 17:09:21 -04:00
DomCrawler Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Dotenv Fix misprint. 2017-04-27 10:47:28 +03:00
EventDispatcher [DI] Make tagged abstract services throw earlier 2017-04-13 15:45:25 +02:00
ExpressionLanguage Merge branch '3.2' 2017-04-19 22:25:39 +02:00
Filesystem Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Finder Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Form [FrameworkBundle] Restore 3.2-like behavior for FormPass, to help BC with Sonata 2017-04-20 15:25:36 +02:00
HttpFoundation Merge branch '3.2' 2017-04-19 22:25:39 +02:00
HttpKernel feature #21502 Persist app bootstrapping logs for logger datacollector (ScullWM, nicolas-grekas) 2017-04-20 11:12:40 -06:00
Inflector Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Intl Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Ldap Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Lock fail when detecting risky tests 2017-04-12 07:15:58 -07:00
OptionsResolver Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Process [Process] Fix BC break: "exec" should remain an internal "detail" 2017-04-20 19:01:24 +02:00
PropertyAccess Merge branch '3.2' 2017-04-12 07:14:56 -07:00
PropertyInfo Merge branch '3.2' 2017-04-19 22:25:39 +02:00
Routing [DI] Make tagged abstract services throw earlier 2017-04-13 15:45:25 +02:00
Security Fix json_login default success/failure handling 2017-04-21 10:18:17 +02:00
Serializer Merge branch '3.2' 2017-04-25 21:46:15 -04:00
Stopwatch Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Templating Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Translation Merge branch '3.2' 2017-04-12 07:14:56 -07:00
Validator [DI] Make tagged abstract services throw earlier 2017-04-13 15:45:25 +02:00
VarDumper feature #21502 Persist app bootstrapping logs for logger datacollector (ScullWM, nicolas-grekas) 2017-04-20 11:12:40 -06:00
WebLink fail when detecting risky tests 2017-04-12 07:15:58 -07:00
Workflow Move ValidateWorkflowsPass to the Workflow component 2017-04-14 12:36:38 +02:00
Yaml Merge branch '3.2' 2017-04-12 22:43:31 +02:00