Code Duplication    Length = 18-18 lines in 2 locations

app/Console/Commands/GitterRoomListenCommand.php 1 location

@@ 42-59 (lines=18) @@
39
     *
40
     * @return mixed
41
     */
42
    public function handle(Repository $config, Container $container)
43
    {
44
        /** @var Client $client */
45
        $client = $this->createClient($container, $config->get('gitter.token'));
46
47
        $this->findRoom($client, $this->argument('room'), function(GitterRoom $room) {
48
            try {
49
                $this->listen($room);
50
            } catch (\Throwable $e) {
51
                $this->error($e->getMessage());
52
            }
53
        });
54
55
56
        /** @var LoopInterface $loop */
57
        $loop = $container->make(LoopInterface::class);
58
        $loop->run();
59
    }
60
61
    /**
62
     * @param GitterRoom $gitter

app/Console/Commands/GitterRoomSyncCommand.php 1 location

@@ 48-65 (lines=18) @@
45
     *
46
     * @return mixed
47
     */
48
    public function handle(Repository $config, Container $container)
49
    {
50
        /** @var Client $client */
51
        $client = $this->createClient($container, $config->get('gitter.token'));
52
53
        // Search room
54
        $this->findRoom($client, $this->argument('room'), function(GitterRoom $room) {
55
            try {
56
                $this->listen($room);
57
            } catch (\Throwable $e) {
58
                $this->error($e->getMessage());
59
            }
60
        });
61
62
        /** @var LoopInterface $loop */
63
        $loop = $container->make(LoopInterface::class);
64
        $loop->run();
65
    }
66
67
    /**
68
     * @param GitterRoom $room