@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.

Update Diviner for array-valued `@doc-stuff` return values from DocblockParser

Summary: Ref T11575. After D16431, the parser may return arrays.

Test Plan: Ran `bin/diviner generate --clean` in `phabricator/` without errors. Previously, this raised some parsing errors related to getting arrays where strings were expected.

Reviewers: chad, yelirekim, joshuaspence

Reviewed By: joshuaspence

Maniphest Tasks: T11575

Differential Revision: https://secure.phabricator.com/D16487

+10 -1
+10 -1
src/applications/diviner/atomizer/DivinerPHPAtomizer.php
··· 141 141 142 142 $docs = idx($metadata, 'param'); 143 143 if ($docs) { 144 - $docs = explode("\n", $docs); 144 + $docs = (array)$docs; 145 145 $docs = array_filter($docs); 146 146 } else { 147 147 $docs = array(); ··· 282 282 '@return')); 283 283 } 284 284 } 285 + 286 + $return = (array)$return; 287 + if (count($return) > 1) { 288 + $atom->addWarning( 289 + pht( 290 + 'Documentation specifies `%s` multiple times.', 291 + '@return')); 292 + } 293 + $return = head($return); 285 294 286 295 if ($atom->getName() == '__construct' && $atom->getType() == 'method') { 287 296 $return_spec = array(