Skip to content

Commit

Permalink
Fix typos in collector, add formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Feb 12, 2020
1 parent 50557c9 commit e234dd4
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/Collectors/Schema.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace Myth\Auth\Collectors;
<?php namespace Tatter\Schemas\Collectors;

/**
* Auth collector
Expand Down Expand Up @@ -52,7 +52,7 @@ class Schema extends \CodeIgniter\Debug\Toolbar\Collectors\BaseCollector
*/
public function __construct()
{
$this->schema = service('schemas')->get()
$this->schema = service('schemas')->get();
}

/**
Expand All @@ -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)';
}

//--------------------------------------------------------------------
Expand All @@ -85,14 +85,21 @@ public function display(): string
{
if (empty($this->schema))
{
return '<p><em>Schema failed to load.</em></p>'
return '<p><em>Schema failed to load.</em></p>';
}
elseif (empty($this->schema->tables))
{
return '<p><em>No tables found.</em></p>'
return '<p><em>No tables found.</em></p>';
}

return @d($this->schema);
$html = '';
foreach ($this->schema->tables as $table)
{
$html .= '<h4>' . $table->name . '</h4>' . PHP_EOL;
$html .= '<pre><code>' . print_r($table, true) . '</pre></code>' . PHP_EOL;
}

return $html;
}

//--------------------------------------------------------------------
Expand Down

0 comments on commit e234dd4

Please sign in to comment.