Commit d6d0769
Document pitfall about Term / TermFallback classes
Plenty of places in Wikibase have something like this:
'value' => $term->getText(),
'language' => $term instanceof TermFallback
? $term->getActualLanguageCode()
: $term->getLanguageCode(),
This is unfortunate, but it’s not entirely clear how we best want to
resolve it (I think Term and TermFallback should be entirely separate
classes – you don’t want a TermFallback in an Item’s TermList either, do
you? – but not 100% sure), nor whether cleaning this up is even worth
the risk of breaking working code. Let’s just document it a bit better
for now.
Change-Id: Ia866ba175c95f0088eae5093bdf684afab83582a1 parent 15ababd commit d6d0769
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| |||
0 commit comments