Skip to content

Commit 2d12866

Browse files
authored
Merge pull request #42 from ioggstream/feat/yamlize
parse yaml with fragments.
2 parents 91e061b + 7ac6bec commit 2d12866

8 files changed

Lines changed: 441 additions & 505 deletions

File tree

data-yml.php

Lines changed: 0 additions & 130 deletions
This file was deleted.

data.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?php
2+
require_once("functions.php");
3+
24
$dimensions = array();
35

46
$files = scandir("data");
57

6-
function readYaml($file)
7-
{
8-
return yaml_parse(
9-
file_get_contents($file)
10-
);
11-
}
128

139
$dimensions = array(
1410
"Application" => readYaml("data/Application.yml"),
1511
"Culture and Org." => readYaml("data/CultureandOrg.yml"),
16-
"Build and Deployment" => readYaml("data/BuildandDeployment.yml"),
12+
"Build and Deployment" => readYaml("data/BuildandDeployment.yml#/sub-dimensions"),
1713
"Information Gathering" => readYaml("data/Informationgathering.yml"),
1814
"Implementation" => readYaml("data/Implementation.yml"),
1915
"Test and Verification" => readYaml("data/TestandVerification.yml")
@@ -176,6 +172,14 @@ function isAssoc(array $arr)
176172
return array_keys($arr) !== range(0, count($arr) - 1);
177173
}
178174

175+
176+
function render_risk($risk) {
177+
178+
if (is_array($risk)) {
179+
return implode("\ ", $risk);
180+
}
181+
return $risk;
182+
}
179183
function build_table_tooltip($array, $headerWeight = 2)
180184
{
181185
$mapKnowLedge = array("Very Low (one discipline)", "Low (one discipline)", "Medium (two disciplines)", "High (two disciplines)", "Very High (three or more disciplines)");
@@ -191,7 +195,7 @@ function build_table_tooltip($array, $headerWeight = 2)
191195

192196
$html = "";
193197
$html .= "<h" . $headerWeight . ">Risk and Opportunity</h$headerWeight>";
194-
$html .= "<div><b>" . "Risk" . ":</b> " . $array['risk'] . "</div>";
198+
$html .= "<div><b>" . "Risk" . ":</b> " . render_risk($array['risk']) . "</div>";
195199
$html .= "<div><b>" . "Opportunity" . ":</b> " . $array['measure'] . "</div>";
196200
if (IS_SHOW_EVIDENCE_TODO || $evidenceContent != "TODO")
197201
$html .= "<div><b>" . "Evidence" . ":</b> " . $evidenceContent . "</div>";

0 commit comments

Comments
 (0)