lasthourcloud/tests/Support/Output.php

18 lines
394 B
PHP
Raw Normal View History

2023-03-20 21:17:28 +00:00
<?php
namespace Tests\Support;
use Illuminate\Support\Collection;
class Output
{
public static function containerList($rawOutput): Collection
{
$outputLines = explode(PHP_EOL, $rawOutput);
return collect($outputLines)
->reject(fn($line) => empty($line))
->map(fn($outputLine) => json_decode($outputLine, flags: JSON_THROW_ON_ERROR));
}
}