@@ -61,9 +61,6 @@ public function add($command): self
6161 */
6262 public function and ($ command ): self
6363 {
64- if (is_string ($ command )) {
65- $ command = $ this ->createCommand ($ command );
66- }
6764 $ this ->commandList [] = ShellList::addAnd ($ this ->parseCommand ($ command ));
6865 return $ this ;
6966 }
@@ -75,23 +72,28 @@ public function and($command): self
7572 */
7673 public function or ($ command ): self
7774 {
78- if (is_string ($ command )) {
79- $ command = $ this ->createCommand ($ command );
80- }
8175 $ this ->commandList [] = ShellList::addOr ($ this ->parseCommand ($ command ));
8276 return $ this ;
8377 }
8478
79+ /**
80+ * @param string|ShellInterface $command
81+ * @return $this
82+ * @throws ShellBuilderException
83+ */
84+ public function async ($ command ): self
85+ {
86+ $ this ->commandList [] = ShellList::async ($ this ->parseCommand ($ command ));
87+ return $ this ;
88+ }
89+
8590 /**
8691 * @param string|ShellInterface $command
8792 * @return $this
8893 * @throws ShellBuilderException
8994 */
9095 public function pipe ($ command ): self
9196 {
92- if (is_string ($ command )) {
93- $ command = $ this ->createCommand ($ command );
94- }
9597 $ this ->commandList [] = Pipeline::pipe ($ this ->parseCommand ($ command ));
9698 return $ this ;
9799 }
@@ -103,9 +105,6 @@ public function pipe($command): self
103105 */
104106 public function pipeWithForward ($ command ): self
105107 {
106- if (is_string ($ command )) {
107- $ command = $ this ->createCommand ($ command );
108- }
109108 $ this ->commandList [] = Pipeline::pipeErrorForward ($ this ->parseCommand ($ command ));
110109 return $ this ;
111110 }
0 commit comments