Problem
ListLookup::getTimestamp() has no native return type. The interface phpdoc says @return int, but the actual implementations disagree:
- 4 SQL implementations (
PropertyUsageListLookup, UndeclaredPropertyListLookup, UnusedPropertyListLookup, UsageStatisticsListLookup) return wfTimestamp(TS_UNIX) which is string|false
CachedListLookup stores the result in a private int $timestamp property, so PHP silently casts the string to int on assignment, and returns int
The implementations' own phpdoc says @return string|false or @return false|string, contradicting the interface's @return int.
Callers
All callers pass the return value to Language::userTimeAndDate() or Language::timeanddate(), which internally call wfTimestamp() and accept any timestamp format — so both string and int work fine in practice.
Options
int — Cast in each SQL implementation with (int)wfTimestamp(TS_UNIX). Matches what callers receive through CachedListLookup. Natural type for Unix timestamps.
string|false — Match what wfTimestamp returns. Change CachedListLookup::$timestamp to string|false. But false can never actually occur (current-time timestamp never fails).
Context
The other three ListLookup methods (fetchList(): array, isFromCache(): bool, getHash(): string) were typed in #6583.
Problem
ListLookup::getTimestamp()has no native return type. The interface phpdoc says@return int, but the actual implementations disagree:PropertyUsageListLookup,UndeclaredPropertyListLookup,UnusedPropertyListLookup,UsageStatisticsListLookup) returnwfTimestamp(TS_UNIX)which isstring|falseCachedListLookupstores the result in aprivate int $timestampproperty, so PHP silently casts the string to int on assignment, and returnsintThe implementations' own phpdoc says
@return string|falseor@return false|string, contradicting the interface's@return int.Callers
All callers pass the return value to
Language::userTimeAndDate()orLanguage::timeanddate(), which internally callwfTimestamp()and accept any timestamp format — so bothstringandintwork fine in practice.Options
int— Cast in each SQL implementation with(int)wfTimestamp(TS_UNIX). Matches what callers receive throughCachedListLookup. Natural type for Unix timestamps.string|false— Match whatwfTimestampreturns. ChangeCachedListLookup::$timestamptostring|false. Butfalsecan never actually occur (current-time timestamp never fails).Context
The other three
ListLookupmethods (fetchList(): array,isFromCache(): bool,getHash(): string) were typed in #6583.