Title: Add warning if newFromText is given non-string/non-null value
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 4 Nov 2015 01:20:36 +0000 (01:20 +0000)
committerKrinkle <krinklemail@gmail.com>
Thu, 5 Nov 2015 19:38:29 +0000 (19:38 +0000)
commitdbd6b4af3f1ffd120918c9bf2096ba6bfd7efc47
treef04d79f6d66b47a0ff9f444ddbc94f23178f0887
parent6da45bcaefda29dc942e0805ff17e2e552797c8e
Title: Add warning if newFromText is given non-string/non-null value

Specify null as allowed value to make this method more easy to use.
The method is often used like that already and this makes it official.
Previously we were on a months-long trajectory to try and remove all
instances of passing null, but it was a never-ending quest (with new
ones introduced all the time). And in all cases the added handling
in the caller is the same as the handling for when this method
returns null. Requiring the caller to bounce null makes code more
complex, duplicates logic and serves no reason. Let this method be
a non-throwing validation method that returns null if given null.

Bug: T76305
Change-Id: I47517021471ac6fd6daca6deee039c8047224a33
includes/Title.php