protected function set_readme_info($response)
{
$readme = array();
foreach ($this->type->sections as $section => $value) {
if ('description' === $section) {
continue;
}
$readme[$section] = $value;
}
foreach ($readme as $key => $value) {
if (!empty($value)) {
unset($response['sections'][$key]);
}
}
$response['remaining_content'] = !empty($response['remaining_content']) ? $response['remaining_content'] : null;
if (empty($response['sections']['other_notes'])) {
unset($response['sections']['other_notes']);
} else {
$response['sections']['other_notes'] .= $response['remaining_content'];
}
unset($response['sections']['screenshots']);
unset($response['sections']['installation']);
$this->type->sections = array_merge((array) $this->type->sections, (array) $response['sections']);
$this->type->tested = isset($response['tested']) ? $response['tested'] : null;
$this->type->requires = isset($response['requires']) ? $response['requires'] : null;
$this->type->donate_link = isset($response['donate_link']) ? $response['donate_link'] : null;
$this->type->contributors = isset($response['contributors']) ? $response['contributors'] : null;
return true;
}