private function renderField(Field $field) { $view = $this->pixie->view('admin/context/field'); $view->fieldName = $field->getName(); $view->source = $field->getSource(); $view->vulnerabilities = $this->renderVulnerabilityTree($field->getVulnerabilityElement()); return $view->render(); }
private function renderField(Field $field) { $result = ['name' => $field->getName(), 'source' => $field->getSource()]; $vulnerabilities = $this->vulnerabilityTreeAsArray($field->getVulnerabilityElement()); if (count($vulnerabilities)) { $result['vulnerabilities'] = $vulnerabilities; } return $result; }