Skip to content

Commit 3bb67fd

Browse files
authored
Format code (#5172)
1 parent 12ef1b6 commit 3bb67fd

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/Command.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Symfony\Component\Console\Question\ChoiceQuestion;
2727
use Symfony\Component\Console\Question\Question;
2828
use Symfony\Component\Console\Style\SymfonyStyle;
29+
use Throwable;
2930

3031
abstract class Command extends SymfonyCommand
3132
{
@@ -421,7 +422,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
421422
$this->eventDispatcher && $this->eventDispatcher->dispatch(new Event\BeforeHandle($this));
422423
$this->handle();
423424
$this->eventDispatcher && $this->eventDispatcher->dispatch(new Event\AfterHandle($this));
424-
} catch (\Throwable $exception) {
425+
} catch (Throwable $exception) {
425426
if (class_exists(ExitException::class) && $exception instanceof ExitException) {
426427
return $this->exitCode = (int) $exception->getStatus();
427428
}

src/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Parser
2121
/**
2222
* Parse the given console command definition into an array.
2323
*
24-
* @throws \InvalidArgumentException
24+
* @throws InvalidArgumentException
2525
*/
2626
public static function parse(string $expression): array
2727
{
@@ -39,7 +39,7 @@ public static function parse(string $expression): array
3939
/**
4040
* Extract the name of the command from the expression.
4141
*
42-
* @throws \InvalidArgumentException
42+
* @throws InvalidArgumentException
4343
*/
4444
protected static function name(string $expression): string
4545
{

tests/Command/FooExceptionCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Hyperf\Command\Command;
1515
use Hyperf\Event\EventDispatcher;
1616
use Hyperf\Event\ListenerProvider;
17+
use RuntimeException;
1718

1819
class FooExceptionCommand extends Command
1920
{
@@ -28,6 +29,6 @@ public function __construct(string $name = null)
2829

2930
public function handle()
3031
{
31-
throw new \RuntimeException('xxx', 99);
32+
throw new RuntimeException('xxx', 99);
3233
}
3334
}

0 commit comments

Comments
 (0)