Skip to content

Commit 4b3cdd8

Browse files
committed
up: update some for use cmd
1 parent c294cca commit 4b3cdd8

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
php: [7.3]
16+
php: [7.4]
1717

1818
steps:
1919
- name: Checkout

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "some system tool library of the php",
55
"keywords": [
66
"library",
7+
"system",
78
"tool",
89
"php"
910
],

src/Cmd/CmdBuilder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ public function addArg($arg): self
124124
*/
125125
public function addArgs(...$args): self
126126
{
127-
$this->args = array_merge($this->args, $args);
127+
if ($args) {
128+
$this->args = array_merge($this->args, $args);
129+
}
130+
128131
return $this;
129132
}
130133

@@ -154,7 +157,6 @@ protected function buildCommandLine(): string
154157
}
155158

156159
$argString = implode(' ', $argList);
157-
158160
return $this->bin . ' ' . $argString;
159161
}
160162

src/Util/PhpException.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,20 @@ class PhpException
2929
* @return string
3030
* @see PhpException::toHtml()
3131
*/
32-
public static function toString(Throwable $e, $getTrace = true, $catcher = null): string
32+
public static function toText(Throwable $e, bool $getTrace = true, $catcher = null): string
33+
{
34+
return self::toHtml($e, $getTrace, $catcher, true);
35+
}
36+
37+
/**
38+
* @param Throwable $e
39+
* @param bool $getTrace
40+
* @param null $catcher
41+
*
42+
* @return string
43+
* @see PhpException::toHtml()
44+
*/
45+
public static function toString(Throwable $e, bool $getTrace = true, $catcher = null): string
3346
{
3447
return self::toHtml($e, $getTrace, $catcher, true);
3548
}

0 commit comments

Comments
 (0)