From 19564c9e18ae456e39bc2c8a306f9e79dd619e11 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Mon, 7 May 2018 15:24:00 +0100 Subject: Docblock and fix toString functions --- src/Script/Output.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/Script/Output.php') 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 + */ class Output { + /** + * Echo out the output data + * + * @author Phil Burton + * @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 + * @param Exception $e + */ public function printException(Exception $e) { echo "An unexpected exception occured:\n" . $e->getMessage() . "\n"; -- cgit v1.2.3