Skip to content

Commit

Permalink
Imports functions (#11)
Browse files Browse the repository at this point in the history
* Imports functions

* 🛠️refactor(scope) restructure file imports in ConfigProvider.php

---------

Co-authored-by: Deeka Wong <[email protected]>
  • Loading branch information
huangdijia and huangdijia committed May 9, 2023
1 parent 7ce27b7 commit d701dc2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/Command/ConsumeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use Hyperf\Coroutine\Coroutine;
use Psr\Container\ContainerInterface;

use function Hyperf\Support\make;

#[Command()]
class ConsumeCommand extends HyperfCommand
{
Expand Down
2 changes: 2 additions & 0 deletions src/Command/SubscribersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use Hyperf\Di\Annotation\AnnotationCollector;
use Psr\Container\ContainerInterface;

use function Hyperf\Collection\collect;

class SubscribersCommand extends HyperfCommand
{
protected ?string $signature = 'describe:subscribers {--C|connection= : connection}';
Expand Down
2 changes: 2 additions & 0 deletions src/Command/TriggersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Hyperf\Di\Annotation\AnnotationCollector;
use Psr\Container\ContainerInterface;

use function Hyperf\Collection\collect;

class TriggersCommand extends HyperfCommand
{
protected ?string $signature = 'describe:triggers {--C|connection= : connection} {--T|table= : Table}';
Expand Down
19 changes: 6 additions & 13 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
*/
namespace FriendsOfHyperf\Trigger;

use FriendsOfHyperf\Trigger\Command\SubscribersCommand;
use FriendsOfHyperf\Trigger\Command\TriggersCommand;
use FriendsOfHyperf\Trigger\Listener\OnBootApplicationListener;
use FriendsOfHyperf\Trigger\Mutex\RedisServerMutex;
use FriendsOfHyperf\Trigger\Mutex\ServerMutexInterface;
use FriendsOfHyperf\Trigger\Snapshot\BinLogCurrentSnapshotInterface;
use FriendsOfHyperf\Trigger\Snapshot\RedisBinLogCurrentSnapshot;

class ConfigProvider
{
public function __invoke(): array
Expand All @@ -29,15 +21,16 @@ public function __invoke(): array
Aspect\BinaryDataReaderAspect::class, // Fix MySQLReplication bug
],
'dependencies' => [
ServerMutexInterface::class => RedisServerMutex::class,
BinLogCurrentSnapshotInterface::class => RedisBinLogCurrentSnapshot::class,
Mutex\ServerMutexInterface::class => Mutex\RedisServerMutex::class,
Snapshot\BinLogCurrentSnapshotInterface::class => Snapshot\RedisBinLogCurrentSnapshot::class,
],
'commands' => [
SubscribersCommand::class,
TriggersCommand::class,
Command\ConsumeCommand::class,
Command\SubscribersCommand::class,
Command\TriggersCommand::class,
],
'listeners' => [
OnBootApplicationListener::class,
Listener\OnBootApplicationListener::class,
],
'publish' => [
[
Expand Down
2 changes: 2 additions & 0 deletions src/Snapshot/RedisBinLogCurrentSnapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Hyperf\Redis\Redis;
use MySQLReplication\BinLog\BinLogCurrent;

use function Hyperf\Support\with;

class RedisBinLogCurrentSnapshot implements BinLogCurrentSnapshotInterface
{
public function __construct(
Expand Down
2 changes: 2 additions & 0 deletions src/Subscriber/TriggerSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
use Psr\Container\ContainerInterface;
use Throwable;

use function Hyperf\Support\call;

class TriggerSubscriber extends AbstractSubscriber
{
use Logger;
Expand Down

0 comments on commit d701dc2

Please sign in to comment.