File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1111
1212use DateTime ;
1313use Exception ;
14- use JetBrains \PhpStorm \Pure ;
1514use Stringable ;
1615use Toolkit \Stdlib \Str \Traits \StringCaseHelperTrait ;
1716use Toolkit \Stdlib \Str \Traits \StringCheckHelperTrait ;
@@ -435,6 +434,19 @@ public static function shellQuotes(array $args): array
435434 return $ newArgs ;
436435 }
437436
437+ /**
438+ * @param array $args
439+ * @param string $prefix
440+ *
441+ * @return string
442+ */
443+ public static function shellQuotesToLine (array $ args , string $ prefix = '' ): string
444+ {
445+ $ args = self ::shellQuotes ($ args );
446+
447+ return ($ prefix ? $ prefix . ' ' : '' ) . implode (' ' , $ args );
448+ }
449+
438450 /**
439451 * @param string $arg
440452 *
@@ -449,6 +461,6 @@ public static function shellQuote(string $arg): string
449461 $ quote = '" ' ;
450462 }
451463
452- return $ quote ? $ arg : "$ quote$ arg$ quote " ;
464+ return $ quote ? "$ quote$ arg$ quote " : $ arg ;
453465 }
454466}
You can’t perform that action at this time.
0 commit comments