1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<?php namespace App\Script; use App\Model\Collection; class Output { public function printCollection(Collection $collection) { if (count($collection) === 0) { echo "No results found\n"; return; } $out = []; foreach ($collection as $vendor) { $out[] = implode("\n", $vendor->toString()); } echo implode("\n\n", $out) . "\n"; } }