Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
typed data system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2013 at 20:28 UTC
Updated:
29 Jul 2014 at 23:13 UTC
Jump to comment: Most recent
Comments
Comment #2
fagod8_duration.patch queued for re-testing.
Comment #3
berdirNot sure I understand the argument as both implementations extend from a primitive data type.
Comment #4
fagoThe implementations yes, but not the interface. The duration is implemented as a string and therefore implements StringInterface, however the DurationInterface should not extend PrimitiveInterface as the duration itself is not primitive. According to PrimitiveInterface - it would have to use get/setValue to get/set the primitive value, i.e. the duration. However, get/setValue does not get/set a duration object as specified by Durationinterface - so extending PrimitiveInterface is wrong.
Comment #5
berdirMakes sense.
If you have a TimeSpan, you can use it as an integer by doing an instanceof IntegerInterface, in that case, it's a primitive value. When you're working with the DurationInterface, it's not.
Comment #6
chx commentedIssue title of the month.
Comment #7
webchickCommitted and pushed to 8.x. Thanks!