Skip to content

Commit 29c42ce

Browse files
committed
add psalm types for new raw command
1 parent acfde8a commit 29c42ce

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/ShellBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
final class ShellBuilder implements ShellInterface, \JsonSerializable
1919
{
20-
/** @var array<ShellInterface> */
20+
/** @var array<ShellInterface|string> */
2121
private $commandList = [];
2222
/** @var int */
2323
private $groupType;
@@ -112,7 +112,7 @@ public function add(...$commands): self
112112
}
113113

114114
/**
115-
* @param $command
115+
* @param string|ShellInterface $command
116116
* @param bool $raw
117117
* @return $this
118118
* @throws ShellBuilderException
@@ -350,7 +350,7 @@ public function __toArray(): array
350350
{
351351
$commands = [];
352352
foreach ($this->commandList as $item) {
353-
$commands[] = $item->__toArray();
353+
$commands[] = is_string($item) ? $item : $item->__toArray();
354354
}
355355
return $commands;
356356
}

0 commit comments

Comments
 (0)