We currently have:
- the TypedData class, which is the base class for "pieces of typed data" (value) objects : a field item, a property...
- the 'typed_data' service (accessed through \Drupal::typedData()), which is not a "piece of typed data", but the TypedDataManager (plugin manager for the above).
So the service id and the associated \Drupal method are misleading when reading code that uses them...
+ Some code use a $this->typedData / $typed_data variable to hold "a piece of typed data", some other to hold "the typed data manager". WTF ;-)
Proposed renames:
- 'typed_data' -> 'typed_data_manager' (like we have the language_manager and entity_manager)
- \Drupal::typedData() -> \Drupal::typedDataManager()
- Go over the $this->typedData / $typed_data variables in core and rename those that refer to the TypedDataManager
Comment | File | Size | Author |
---|---|---|---|
#18 | interdiff.txt | 2.51 KB | amateescu |
#18 | rename_typed_data-2132145-18.patch | 28.85 KB | amateescu |
#17 | rename_typed_data-2132145-17.patch | 29 KB | plopesc |
#16 | rename_typed_data-2132145-16.patch | 29.01 KB | plopesc |
#12 | rename_typed_data-2132145-12.patch | 30.06 KB | plopesc |
Comments
Comment #1
yched CreditAttribution: yched commentedAdding a couple tags - not sure what the right ones are for TypedData ?
Comment #2
plopescPatch renaming typed_data service to typed_data_manager and converting *->typedData / $typed_data references to *->typedDataManager / $typed_data_manager when refer to TypedDataManager.
Let's see testbot...
Comment #4
plopescSorry, I forgot to include test files...
Comment #5
BerdirMakes sense. The name is because the function was called typed_data() and it predated the concept of plugin managers.
Comment #6
yched CreditAttribution: yched commentedYay, thanks @plopesc !
@Berdir: ah true, typed data API was not plugin-based initially. Makes sense.
(+ lol at #2125679: "name" in issue titles is replaced with "Drupal.org" in page title, especially funny here...)
Comment #7
Xano4: rename_typed_data-2132145-4.patch queued for re-testing.
Comment #8
Berdir4: rename_typed_data-2132145-4.patch queued for re-testing.
Comment #10
plopescRe-rolling...
Comment #11
XanoRe-roll.
Comment #12
plopescNew Re-roll
Comment #13
yched CreditAttribution: yched commentedStill RTBC if green.
Side note: when rerolling RTBC patches, unless there are other changes besides the reroll, it's best to leave them at RTBC, the bot will kick back to "needs work" if the reroll causes test fails. Otherwise the issue easily drops out of the radar :-)
Comment #14
LinL CreditAttribution: LinL commented12: rename_typed_data-2132145-12.patch queued for re-testing.
Comment #16
plopescRe-roll
Comment #17
plopescRe-roll after #2143263: Remove "Field" prefix from FieldDefinitionInterface methods
Comment #18
amateescu CreditAttribution: amateescu commentedFixed some unneeded empty lines.
Comment #19
yched CreditAttribution: yched commentedNo commit :(
Probably needs a reroll ?
18: rename_typed_data-2132145-18.patch queued for re-testing.
Comment #20
yched CreditAttribution: yched commentedComment #21
webchickCommitted and pushed to 8.x. Thanks!