Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/controller/DivinerAtomController.php
Show First 20 Lines • Show All 429 Lines • ▼ Show 20 Lines | private function composeTasks(DivinerLiveSymbol $symbol) { | ||||
$extends_task_specs = array(); | $extends_task_specs = array(); | ||||
foreach ($symbol->getExtends() as $extends) { | foreach ($symbol->getExtends() as $extends) { | ||||
$extends_task_specs += $this->composeTasks($extends); | $extends_task_specs += $this->composeTasks($extends); | ||||
} | } | ||||
$task_specs = array(); | $task_specs = array(); | ||||
$tasks = $symbol->getAtom()->getDocblockMetaValue('task'); | $tasks = $symbol->getAtom()->getDocblockMetaValue('task'); | ||||
if (!is_array($tasks)) { | |||||
if (strlen($tasks)) { | |||||
$tasks = array($tasks); | |||||
} else { | |||||
$tasks = array(); | |||||
} | |||||
} | |||||
if ($tasks) { | if ($tasks) { | ||||
foreach ($tasks as $task) { | foreach ($tasks as $task) { | ||||
list($name, $title) = explode(' ', $task, 2); | list($name, $title) = explode(' ', $task, 2); | ||||
$name = trim($name); | $name = trim($name); | ||||
$title = trim($title); | $title = trim($title); | ||||
$task_specs[$name] = array( | $task_specs[$name] = array( | ||||
'name' => $name, | 'name' => $name, | ||||
▲ Show 20 Lines • Show All 241 Lines • Show Last 20 Lines |