From e234dd470d79ddc256d18e008a7426540120eb21 Mon Sep 17 00:00:00 2001 From: Matt Gatner Date: Wed, 12 Feb 2020 20:34:27 +0000 Subject: [PATCH] Fix typos in collector, add formatting --- src/Collectors/Schema.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/Collectors/Schema.php b/src/Collectors/Schema.php index 2cd8f39..ba80968 100644 --- a/src/Collectors/Schema.php +++ b/src/Collectors/Schema.php @@ -1,4 +1,4 @@ -schema = service('schemas')->get() + $this->schema = service('schemas')->get(); } /** @@ -64,14 +64,14 @@ public function getTitleDetails(): string { if (empty($this->schema)) { - return 'Schema failure' + return '(Failure)'; } elseif (empty($this->schema->tables)) { - return 'No tables' + return '(No tables)'; } - return count($this->schema->tables) . ' tables'; + return '(' . count($this->schema->tables) . ' tables)'; } //-------------------------------------------------------------------- @@ -85,14 +85,21 @@ public function display(): string { if (empty($this->schema)) { - return '

Schema failed to load.

' + return '

Schema failed to load.

'; } elseif (empty($this->schema->tables)) { - return '

No tables found.

' + return '

No tables found.

'; } - return @d($this->schema); + $html = ''; + foreach ($this->schema->tables as $table) + { + $html .= '

' . $table->name . '

' . PHP_EOL; + $html .= '
' . print_r($table, true) . '
' . PHP_EOL; + } + + return $html; } //--------------------------------------------------------------------