Problem/Motivation
ConfigurableResourceType
extends the ResourceType
class. The configurable lives in this module, the base class lives in the JSON API module. Given that ResourceType
is an internal class we break JSON API often.
This happens whenever the __construct
class gets an argument. That is because on top of the base arguments we need to pass additional services to make ConfigurableResourceType
configurable.
We want to avoid updating ConfigurableResourceType
every time ResourceType::__construct
is updated.
Proposed resolution
Use the setter injection pattern instead of the constructor injection pattern for ConfigurableResourceType
.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2992557--interdiff--5-7.txt | 1.62 KB | e0ipso |
#7 | 2992557--injection-setter--7.patch | 7.63 KB | e0ipso |
| |||
#5 | 2992557--interdiff--2-5.txt | 1.54 KB | e0ipso |
#5 | 2992557--injection-setter--5.patch | 7.2 KB | e0ipso |
| |||
#2 | 2992557--injection-setter--2.patch | 6.88 KB | e0ipso |
Comments
Comment #2
e0ipsoLet's see what breaks with this patch.
Comment #3
e0ipsoComment #5
e0ipsoSupport for
isInternal
.Comment #6
e0ipsoComment #7
e0ipsoAllow disabling via
isInternal
.Comment #8
e0ipsoOnce #2995111: shouldBeInternalResourceType et al. should receive the resource type, not the entity type is backported to 1.x we can remove the
setInternal
and overridestatic:: shouldBeInternalResourceType
to check for the config entity value.Comment #10
e0ipsoComment #11
Wim LeersNice hardening!