Commit 2552230
Add stubs for daterange field type (#786)
* Add stubs for datetime field type
* Set date property of DateTimeItem to be writable
* Add stubs for daterange field type
* Use property instead of property-read
* Use never type for DateRangeItem::$date and add test coverage
DateRangeItem::propertyDefinitions() does not call parent:: so the
inherited $date property from DateTimeItem does not exist at runtime.
Using @Property never $date accurately signals this is inaccessible,
rather than null which implied the property was valid to access.
Also add assertType('never', ...) to cover this override in tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Matt Glaman <nmd.matt@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 5882da9 commit 2552230
File tree
2 files changed
+29
-0
lines changed- stubs/Drupal/datetime_range/Plugin/Field/FieldType
- tests/src/Type/data
2 files changed
+29
-0
lines changedLines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
159 | 170 | | |
160 | 171 | | |
161 | 172 | | |
| |||
0 commit comments