We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82be07f commit 14d623dCopy full SHA for 14d623d
src/Cmd/AbstractCmdBuilder.php
@@ -11,6 +11,7 @@
11
12
use RuntimeException;
13
use Toolkit\Stdlib\Helper\Assert;
14
+use Toolkit\Stdlib\Str;
15
use Toolkit\Sys\Exec;
16
use function trim;
17
@@ -277,11 +278,23 @@ public function isSuccess(): bool
277
278
*
279
* @return string
280
*/
- public function getOutput(bool $trim = false): string
281
+ public function getOutput(bool $trim = true): string
282
{
283
return $trim ? trim($this->output) : $this->output;
284
}
285
286
+ /**
287
+ * get output as lines
288
+ *
289
+ * @return string[]
290
+ */
291
+ public function getOutputLines(): array
292
+ {
293
+ $out = trim($this->output);
294
+
295
+ return $out ? Str::splitTrimmed($out, "\n") : [];
296
+ }
297
298
/**
299
* @return array
300
0 commit comments