Skip to content

Commit 1a17784

Browse files
committed
update some for error tips and sigle list
1 parent 7309020 commit 1a17784

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

Diff for: src/Application.php

-2
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ protected function getFileFilter(): callable
258258

259259
/**
260260
* @inheritdoc
261-
* @throws ReflectionException
262261
*/
263262
public function dispatch(string $name, bool $detachedRun = false)
264263
{
@@ -361,7 +360,6 @@ protected function runCommand(string $name, $handler, array $options)
361360
* @param bool $detachedRun
362361
*
363362
* @return mixed
364-
* @throws ReflectionException
365363
*/
366364
protected function runAction(array $info, array $options, bool $detachedRun = false)
367365
{

Diff for: src/Component/Formatter/SingleList.php

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public static function show($data, string $title = 'Information', array $opts =
4444
'keyStyle' => 'info',
4545
'keyMinWidth' => 8,
4646
'titleStyle' => 'comment',
47+
'ucFirst' => false,
4748
'returned' => false,
4849
'ucTitleWords' => true,
4950
'lastNewline' => true,

Diff for: src/Controller.php

-5
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ protected function onNotFound(string $action): bool
196196
* @param string $command command in the group
197197
*
198198
* @return int|mixed
199-
* @throws ReflectionException
200199
*/
201200
public function run(string $command = '')
202201
{
@@ -361,7 +360,6 @@ final public function execute($input, $output)
361360

362361
/**
363362
* @return bool
364-
* @throws ReflectionException
365363
*/
366364
protected function showHelp(): bool
367365
{
@@ -404,7 +402,6 @@ public function getGroupOptions(): array
404402
* -s, --search Search command by input keywords
405403
* --format Set the help information dump format(raw, xml, json, markdown)
406404
* @return int
407-
* @throws ReflectionException
408405
* @example
409406
* {script} {name} -h
410407
* {script} {name}:help
@@ -453,8 +450,6 @@ protected function beforeShowCommandList(): void
453450

454451
/**
455452
* Display all sub-commands list of the controller class
456-
*
457-
* @throws ReflectionException
458453
*/
459454
final public function showCommandList(): void
460455
{

Diff for: src/Exception/PromptException.php

+10
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@
1717
*/
1818
class PromptException extends InvalidArgumentException
1919
{
20+
/**
21+
* @param string $msg
22+
* @param int $code
23+
*
24+
* @return static
25+
*/
26+
public static function new(string $msg, int $code = 0): self
27+
{
28+
return new self($msg, $code);
29+
}
2030
}

0 commit comments

Comments
 (0)