We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acfde8a commit 29c42ceCopy full SHA for 29c42ce
1 file changed
src/ShellBuilder.php
@@ -17,7 +17,7 @@
17
18
final class ShellBuilder implements ShellInterface, \JsonSerializable
19
{
20
- /** @var array<ShellInterface> */
+ /** @var array<ShellInterface|string> */
21
private $commandList = [];
22
/** @var int */
23
private $groupType;
@@ -112,7 +112,7 @@ public function add(...$commands): self
112
}
113
114
/**
115
- * @param $command
+ * @param string|ShellInterface $command
116
* @param bool $raw
117
* @return $this
118
* @throws ShellBuilderException
@@ -350,7 +350,7 @@ public function __toArray(): array
350
351
$commands = [];
352
foreach ($this->commandList as $item) {
353
- $commands[] = $item->__toArray();
+ $commands[] = is_string($item) ? $item : $item->__toArray();
354
355
return $commands;
356
0 commit comments