summaryrefslogtreecommitdiff
path: root/src/Script/Output.php
blob: 8f7a689ed4a1595d97cea5612b46943fe97a3a45 (plain)
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";
    }
}