Skip to content

Commit c905d05

Browse files
authored
Format code (#5172)
1 parent 95fde85 commit c905d05

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/Driver/Driver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Hyperf\Utils\Packer\PhpSerializerPacker;
2626
use Psr\Container\ContainerInterface;
2727
use Psr\EventDispatcher\EventDispatcherInterface;
28+
use Throwable;
2829

2930
abstract class Driver implements DriverInterface
3031
{
@@ -75,7 +76,7 @@ public function consume(): void
7576
if ($maxMessages > 0 && $messageCount >= $maxMessages) {
7677
break;
7778
}
78-
} catch (\Throwable $exception) {
79+
} catch (Throwable $exception) {
7980
$logger = $this->container->get(StdoutLoggerInterface::class);
8081
$logger->error((string) $exception);
8182
} finally {
@@ -103,7 +104,7 @@ protected function getCallback($data, $message): callable
103104
}
104105

105106
$this->ack($data);
106-
} catch (\Throwable $ex) {
107+
} catch (Throwable $ex) {
107108
if (isset($message, $data)) {
108109
if ($message->attempts() && $this->remove($data)) {
109110
$this->event && $this->event->dispatch(new RetryHandle($message, $ex));

src/Exception/InvalidDriverException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*/
1212
namespace Hyperf\AsyncQueue\Exception;
1313

14-
class InvalidDriverException extends \RuntimeException
14+
use RuntimeException;
15+
16+
class InvalidDriverException extends RuntimeException
1517
{
1618
}

src/Exception/InvalidPackerException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*/
1212
namespace Hyperf\AsyncQueue\Exception;
1313

14-
class InvalidPackerException extends \RuntimeException
14+
use RuntimeException;
15+
16+
class InvalidPackerException extends RuntimeException
1517
{
1618
}

src/Exception/InvalidQueueException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*/
1212
namespace Hyperf\AsyncQueue\Exception;
1313

14-
class InvalidQueueException extends \RuntimeException
14+
use RuntimeException;
15+
16+
class InvalidQueueException extends RuntimeException
1517
{
1618
}

0 commit comments

Comments
 (0)