@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Diviner: Parse generic types in doc blocks better

Summary:
Type hints for parameters can be generic, such as `array<string,int>`.
Some of these contain spaces, like `array<string, int>`, which was parsed incorrectly previously.
This resulted in a line like ` * @param map<string, string> $attributes (optional) A map of tag attributes.` rendering as
`map<string, | $attributes | string> $attributes (optional) A map of tag attributes.` instead of
`map<string,string> | $attributes | $attributes (optional) A map of tag attributes.`.

Closes T16499

Test Plan:
* Run `./bin/diviner generate` on git master
* Look at the "Parameters" box on http://phorge.localhost/book/dev/function/phutil_tag/
* Apply this patch
* Run `./bin/diviner generate --clean`
* Look at the "Parameters" box on http://phorge.localhost/book/dev/function/phutil_tag/

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16499

Differential Revision: https://we.phorge.it/D26752

+1 -1
+1 -1
src/applications/diviner/atomizer/DivinerPHPAtomizer.php
··· 231 231 232 232 protected function parseParamDoc(DivinerAtom $atom, $doc, $name) { 233 233 $dict = array(); 234 - $split = preg_split('/\s+/', trim($doc), 2); 234 + $split = preg_split('/(?<!,)\s+/', trim($doc), 2); 235 235 if (!empty($split[0])) { 236 236 $dict['doctype'] = $split[0]; 237 237 }