Differential D8263 Diff 19662 src/infrastructure/customfield/parser/PhabricatorCustomFieldMonogramParser.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/customfield/parser/PhabricatorCustomFieldMonogramParser.php
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | public function parseCorpus($corpus) { | ||||
$results = array(); | $results = array(); | ||||
foreach ($matches as $set) { | foreach ($matches as $set) { | ||||
$results[] = array( | $results[] = array( | ||||
'match' => $set[0][0], | 'match' => $set[0][0], | ||||
'prefix' => $set[1][0], | 'prefix' => $set[1][0], | ||||
'infix' => $set[2][0], | 'infix' => $set[2][0], | ||||
'monograms' => array_filter(preg_split('/[,\s]+/', $set[3][0])), | 'monograms' => array_filter(preg_split('/[,\s]+/', $set[3][0])), | ||||
'suffix' => $set[4][0], | 'suffix' => idx(idx($set, 4, array()), 0, ''), | ||||
'offset' => $set[0][1], | 'offset' => $set[0][1], | ||||
); | ); | ||||
} | } | ||||
return $results; | return $results; | ||||
} | } | ||||
private function buildRegex(array $list, $optional = false, $final = false) { | private function buildRegex(array $list, $optional = false, $final = false) { | ||||
Show All 13 Lines |