File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11
11
12
12
use DateTime ;
13
13
use Exception ;
14
- use JetBrains \PhpStorm \Pure ;
15
14
use Stringable ;
16
15
use Toolkit \Stdlib \Str \Traits \StringCaseHelperTrait ;
17
16
use Toolkit \Stdlib \Str \Traits \StringCheckHelperTrait ;
@@ -435,6 +434,19 @@ public static function shellQuotes(array $args): array
435
434
return $ newArgs ;
436
435
}
437
436
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
+
438
450
/**
439
451
* @param string $arg
440
452
*
@@ -449,6 +461,6 @@ public static function shellQuote(string $arg): string
449
461
$ quote = '" ' ;
450
462
}
451
463
452
- return $ quote ? $ arg : "$ quote$ arg$ quote " ;
464
+ return $ quote ? "$ quote$ arg$ quote " : $ arg ;
453
465
}
454
466
}
You can’t perform that action at this time.
0 commit comments