class Json in Site Audit 8.3
Hierarchy
- class \Drupal\site_audit\Renderer uses StringTranslationTrait
- class \Drupal\site_audit\Renderer\Json
Expanded class hierarchy of Json
1 file declares its use of Json
- SiteAuditCommands.php in src/
Commands/ SiteAuditCommands.php
File
- src/
Renderer/ Json.php, line 10
Namespace
Drupal\site_audit\RendererView source
class Json extends Renderer {
/**
*
*/
public function render($detail = FALSE) {
$report = [
'percent' => $this->report
->getPercent(),
'label' => $this->report
->getLabel(),
'checks' => [],
];
foreach ($this->report
->getCheckObjects() as $check) {
$report['checks'][get_class($check)] = [
'label' => $check
->getLabel(),
'description' => $check
->getDescription(),
'result' => $check
->getResult(),
'action' => $check
->renderAction(),
'score' => $check
->getScore(),
];
}
return json_encode($report);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Json:: |
public | function |
Overrides Renderer:: |
|
Renderer:: |
public | property | The logger we are using for output. | |
Renderer:: |
public | property | Any options that have been passed in. | |
Renderer:: |
public | property | Output interface. | 1 |
Renderer:: |
public | property | The Report to be rendered. | |
Renderer:: |
public | function | 2 | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |