Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Fix Error in Charts Extension
Browse files Browse the repository at this point in the history
  • Loading branch information
kimbtech committed Sep 24, 2020
1 parent d980b45 commit 709c8da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extensions/charts/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"events" : {
"statsViewed" : "TTTCharts\\Charts::statsViewed"
},
"version" : "v1.0.2"
"version" : "v1.0.3"
}
4 changes: 2 additions & 2 deletions extensions/charts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ private static function createBar(array $data) : string {
$c = str_repeat("-", self::LINE_LENGTH+1) . PHP_EOL;
$fullLength = 0;
foreach($lengths as $name => $d){
if( $d > 0){
if( $d > 0 ){
$c .= '|' . \str_pad($name, $d - 1, " ", STR_PAD_BOTH);
$fullLength += $d < 1 ? 1 : $d;
}
}
$c .= str_repeat(" ", self::LINE_LENGTH - $fullLength) . '|' . PHP_EOL;
$c .= ( self::LINE_LENGTH - $fullLength > 0 ? str_repeat(" ", self::LINE_LENGTH - $fullLength) : '') . '|' . PHP_EOL;
$c .= str_repeat("-", self::LINE_LENGTH+1);
return $c;
}
Expand Down

0 comments on commit 709c8da

Please sign in to comment.