1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 10:22:42 +01:00

Improve atomizing of PHP @return annotation

Summary: Fixes T6890. This doesn't feel like a perfect solution, but I can't think of any cases in which this will produce the wrong result either.

Test Plan: Ran `./bin/diviner generate` and checked the generated documentation for `PhabricatorCommonPasswords::loadWordlist()`. The return type was corrected shown as `map<string, bool>`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6890

Differential Revision: https://secure.phabricator.com/D11469
This commit is contained in:
Joshua Spence 2015-01-23 07:18:10 +11:00
parent 25ee2d4508
commit 7bd2994c2e

View file

@ -293,7 +293,7 @@ final class DivinerPHPAtomizer extends DivinerAtomizer {
'this implicitly.');
}
} else if ($return) {
$split = preg_split('/\s+/', trim($return), $limit = 2);
$split = preg_split('/(?<!,)\s+/', trim($return), $limit = 2);
if (!empty($split[0])) {
$type = $split[0];
}