time: Implement ConvertableTimestamp::convert()
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 21 Sep 2016 00:19:00 +0000 (01:19 +0100)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 22 Sep 2016 03:38:07 +0000 (03:38 +0000)
commitc46aa59dadd6d1417ad9ab8a17af492f5c5895a5
treecb88f88e6ab5c9fff2477508fa4d7093a1714e36
parente018ed109ef1435e23f571de379beeaacfa3253c
time: Implement ConvertableTimestamp::convert()

* This method is analogous to wfTimestamp(). Optimise for the common
idiom of just converting a timestamp without having the caller hold
on to any object.

* Make wfTimestamp() use this (it could already since it didn't
use any MWTimestamp methods). Use via MWTimestamp. While this is
the same as direct access, it allows future changes.

* Add tests covering this new method.

Change-Id: I7f9104f1701d92fe25d72c7943581c64e1d093fa
includes/GlobalFunctions.php
includes/libs/time/ConvertableTimestamp.php
tests/phpunit/includes/libs/time/ConvertableTimestampTest.php