1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-02 09:58:24 +01:00

Use "phutil_string_cast()" in TypeaheadDatasource

Summary:
Depends on D20138. Ref T13250. This improves exception behavior and gives us a standard page with a stack trace instead of a text fatal with no stack trace.

Truly a great day for PHP.

(Eventually we may want to replace all `(string)` with `phutil_string_cast()`, but let's let it have some time in the wild first?)

Test Plan: Triggered the error, got a more useful exception behavior.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13250

Differential Revision: https://secure.phabricator.com/D20140
This commit is contained in:
epriestley 2019-02-11 09:58:38 -08:00
parent 77247084bd
commit 1275326ea6

View file

@ -101,7 +101,7 @@ abstract class PhabricatorTypeaheadDatasource extends Phobject {
public function getDatasourceURI() {
$uri = new PhutilURI('/typeahead/class/'.get_class($this).'/');
$uri->setQueryParams($this->newURIParameters());
return (string)$uri;
return phutil_string_cast($uri);
}
public function getBrowseURI() {
@ -111,7 +111,7 @@ abstract class PhabricatorTypeaheadDatasource extends Phobject {
$uri = new PhutilURI('/typeahead/browse/'.get_class($this).'/');
$uri->setQueryParams($this->newURIParameters());
return (string)$uri;
return phutil_string_cast($uri);
}
private function newURIParameters() {