Differential D25179 Diff 637 src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
Show First 20 Lines • Show All 458 Lines • ▼ Show 20 Lines | /* -( Token Functions )---------------------------------------------------- */ | ||||
/** | /** | ||||
* @task functions | * @task functions | ||||
*/ | */ | ||||
public static function isFunctionToken($token) { | public static function isFunctionToken($token) { | ||||
// We're looking for a "(" so that a string like "members(q" is identified | // We're looking for a "(" so that a string like "members(q" is identified | ||||
// and parsed as a function call. This allows us to start generating | // and parsed as a function call. This allows us to start generating | ||||
// results immediately, before the user fully types out "members(quack)". | // results immediately, before the user fully types out "members(quack)". | ||||
if ($token) { | |||||
valerio.bozzolan: ✅ I verified the above line
Yes, we are aware that the `if($token)` skips the string `"0"` and… | |||||
return (strpos($token, '(') !== false); | return (strpos($token, '(') !== false); | ||||
} else { | |||||
return false; | |||||
} | |||||
} | } | ||||
/** | /** | ||||
* @task functions | * @task functions | ||||
*/ | */ | ||||
protected function parseFunction($token, $allow_partial = false) { | protected function parseFunction($token, $allow_partial = false) { | ||||
$matches = null; | $matches = null; | ||||
▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ I verified the above line
Yes, we are aware that the if($token) skips the string "0" and it has sense here.
This is valid since a function token must contain a bracket to be valid.