diff options
Diffstat (limited to 'src/Script/Output.php')
-rw-r--r-- | src/Script/Output.php | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/Script/Output.php b/src/Script/Output.php index e61cff8..4598dc1 100644 --- a/src/Script/Output.php +++ b/src/Script/Output.php @@ -5,8 +5,19 @@ namespace App\Script; use App\Model\Collection; use Exception; +/** + * Handle output to CLI + * + * @author Phil Burton <phil@pgburton.com> + */ class Output { + /** + * Echo out the output data + * + * @author Phil Burton <phil@pgburton.com> + * @param Collection $collection + */ public function printCollection(Collection $collection) { if (count($collection) === 0) { @@ -14,14 +25,15 @@ class Output return; } - $out = []; - foreach ($collection as $vendor) { - $out[] = implode("\n", $vendor->toString()); - } - - echo implode("\n\n", $out) . "\n"; + echo $collection->toString() . "\n"; } + /** + * Output the exception message + * + * @author Phil Burton <phil@pgburton.com> + * @param Exception $e + */ public function printException(Exception $e) { echo "An unexpected exception occured:\n" . $e->getMessage() . "\n"; |