Page MenuHomeDevCentral

No OneTemporary

diff --git a/src/Output/MarkdownOutput.php b/src/Output/MarkdownOutput.php
index 45823e7..b9dfcb3 100644
--- a/src/Output/MarkdownOutput.php
+++ b/src/Output/MarkdownOutput.php
@@ -1,55 +1,53 @@
<?php
namespace Keruald\Reporting\Output;
class MarkdownOutput extends Output {
public function render () : string {
$send = [];
$send[] = '# ' . $this->report->title;
$send[] = '';
foreach ($this->report->sections as $section) {
$send[] = '## ' . $section->title;
$send[] = '';
foreach ($section->entries as $entry) {
$send[] = '### ' . $entry->title;
$send[] = '';
$send[] = $entry->text;
$send[] = '';
}
}
$send[] = '---';
$send[] = '';
$properties = $this->report->properties;
$propertyMaxLength = 0;
$maxValue = 0;
foreach ($properties as $key => $value) {
$propertyMaxLength = max($propertyMaxLength, strlen($key));
$maxValue = max($maxValue, strlen($value));
}
- if ($propertyMaxLength < 8) {
- $propertyMaxLength = 8;
- }
+ $propertyMaxLength = max(8, $propertyMaxLength);
$send[] = '| Property' . str_repeat(' ', $propertyMaxLength - 8) . ' | '
. str_repeat(' ', $maxValue) . ' |';
$send[] = '|' . str_repeat('-', $propertyMaxLength + 2) . '|'
. str_repeat('-', $maxValue + 2) . '|';
foreach ($properties as $key => $value) {
$send[] =
'| ' . $key . str_repeat(' ', $propertyMaxLength - strlen($key))
. ' | '
. $value . str_repeat(' ', $maxValue - strlen($value)) . ' |';
}
$send[] = '';
return implode("\n", $send);
}
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Sep 18, 02:03 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2989759
Default Alt Text
(1 KB)

Event Timeline